Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Danderci
Newbie


Joined: 21 Jan 2018
Posts: 2

PostPosted: Sun Jan 21, 2018 5:51 am   

Huge lag running a Script
 
Ok so I use this healing script on my healer to keep the group full hp and mana, but in groups with 3 people it will freeze up for 1 round, 4 people is 2 rounds ECT... I have a friend that uses the same script on his zmud and has no issues. The script is as follows....


</trigger>
<class name="grouphealscripts">
<trigger priority="41090">
<pattern>(%d)Spirit></pattern>
<value>#VA Energy %1</value>
</trigger>
<trigger priority="41100">
<pattern>Exp needed Level</pattern>
<value>#VA novoid 0
#VA groupMember 0
#T+ GroupTan</value>
</trigger>
<trigger priority="41110">
<pattern>You join the fight!</pattern>
<value>#VA keepHealing 0</value>
</trigger>
<class name="page2">
<alias name="scrCalcHeal">
<value><![CDATA[#math missinghp (@storHPM-@storHPC)
#if (@missinghp>5000) {
#math mastargets (@mastargets+1)
#math novoid (@novoid+1)
#var mastarget @posManaTarget
} {
#if (@missinghp>1200) {
#math restargets (@restargets+1)
#math novoid (@novoid+1)
#var restarget @posManaTarget
}
}
#math missingmana (@storMPM-@storMPC)
#if (@highmissmana<@missingmana) {#VAR highmissmana @missingmana} {}
#if (@missingmana>1000) {
#if (@missingmana>=@highmissmana) {
#VAR manatarget @posManaTarget
#math novoid (@novoid+1)
#VAR castingmana 1
}
} {}
#if (@groupMember=@groupSize) {scrDoHeal} {}
#T+ GroupTank]]></value>
</alias>
<alias name="scrDoHeal">
<value>#VAR highmissmana 0
#T+ GroupTank
#if (@mastargets>1) {
gmas
#var restargets 0
#var mastargets 0
} {}
#if (@mastargets=1) {
c 'massive heal' @mastarget
#var mastargets 0
} {}
#if (@restargets>1) {
gres
#var restargets 0
} {}
#if (@restargets=1) {
c 'res' @restarget
#var restargets 0
} {}
#if (@castingmana=1) {
mn @manatarget
#VAR castingmana 0
} {}
#if (@novoid=0) {
#VA keepHealing 0
#if (@mymana=0) {
#if (@Energy>8000) {
brand
#VAR novoid 1
} {}
}
} {}
#if (@keepHealing=1) {group} {}</value>
</alias>
<alias name="Healup">
<value>#VA keepHealing 1
group</value>
</alias>
<alias name="Healoff">
<value>#VA keepHealing 0
group</value>
</alias>
<alias name="Gs">
<value>#VA groupSize %1
#echo Group Size set to @groupSize</value>
</alias>
<alias name="clearHeal">
<value>#VA missinghp 0
#VA castingmana 0</value>
</alias>
<trigger priority="41480">
<pattern>(%d)/(%d)</pattern>
<value>#VA storHPC %1
#VA storHPM %2</value>
</trigger>
<trigger priority="41490">
<pattern>(%d)/(%d)??%s%d/%d? ??? ??? ??????? ??%s%d?? ??%d? ?Mu?? (%w)</pattern>
<value>#VA storMPC %1
#VA storMPM %2
#math groupMember (@groupMember+1)
#VA posManaTarget %3
scrCalcHeal</value>
</trigger>
<trigger priority="41500">
<pattern>(%d)/(%d)??%s%d/%d? ??? ??? ??????? ??%s%d?? ??%d? ?Cl?? (%w)</pattern>
<value>#VA storMPC %1
#VA storMPM %2
#math groupMember (@groupMember+1)
#VA posManaTarget %3
scrCalcHeal</value>
</trigger>
<trigger priority="41510">
<pattern>(%d)/(%d)???%s%d/%d? ??? ??? ??????? ??%s%d?? ??%d? ?Wa?? (%w)</pattern>
<value>#VA storMPC %1
#VA storMPM %2
#math groupMember (@groupMember+1)
#VA posManaTarget %3
scrCalcHeal</value>
</trigger>
<trigger priority="41520">
<pattern>(%d)/(%d)???%s%d/%d? ??? ??? ??????? ??%s%d?? ??%d? ?Th?? (%w)</pattern>
<value>#VA storMPC %1
#VA storMPM %2
#math groupMember (@groupMember+1)
#VA posManaTarget %3
scrCalcHeal</value>
</trigger>
</class>
<class name="GroupTank">
<trigger priority="41260">
<pattern>TANK(*) is in excellent condition</pattern>
<value>chkGroup</value>
</trigger>
<trigger priority="41270">
<pattern>TANK(*) has a few scratches.</pattern>
<value>chkGroup</value>
</trigger>
<trigger priority="41280">
<pattern>TANK(*) has some small wounds and bruises.</pattern>
<value>c 'restoration' %1
chkGroup</value>
</trigger>
<trigger priority="41290">
<pattern>?TANK?(*)? ?has? ?quite? ?a? ?few? ?wounds.</pattern>
<value>c 'massive heal' %1
chkGroup</value>
</trigger>
<trigger priority="41300">
<pattern>?TANK?(*)? ?has? ?some? ?big? ?nasty? ?wounds? ?and? ?scratches.$</pattern>
<value>c 'massive heal' %1
chkGroup</value>
</trigger>
<trigger priority="41310">
<pattern>?TANK?(*)? ?looks? ?pretty? ?hurt$</pattern>
<value>c 'massive heal' %1
chkGroup</value>
</trigger>
<trigger priority="41320">
<pattern>?TANK?(*)? ?is? ?in? ?awful? ?condition</pattern>
<value>c 'massive heal' %1
chkGroup</value>
</trigger>
<alias name="chkGroup">
<value>clearHeal
group
#T- GroupTank</value>
</alias>
</class>
<alias name="mn">
<value>c 'mana' %n %1</value>
</alias>
<alias name="gres">
<value>c 'group restor</value>
</alias>
<alias name="gmas">
<value>c 'group massive</value>
</alias>
</class>
</class>
</cmud>
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3797
Location: Pensacola, FL, USA

PostPosted: Sun Jan 21, 2018 7:33 am   
 
Nothing is jumping out at me as the cause for the delay in this.
I recall hearing some mention of stuff with the #MATH command in CMUD, but I forget what exactly.
But a direct assignment is usually better:

var=(@var+1)

The only thing else it might be, is that rather unsightly mess of ?s in your trigger patterns.
See if you cant tighten the patterns up a bit.
Hard to make suggestions without the corresponding MUD output.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
Danderci
Newbie


Joined: 21 Jan 2018
Posts: 2

PostPosted: Sun Jan 21, 2018 9:17 am   
 
shalimar wrote:
Nothing is jumping out at me as the cause for the delay in this.
I recall hearing some mention of stuff with the #MATH command in CMUD, but I forget what exactly.
But a direct assignment is usually better:

var=(@var+1)

The only thing else it might be, is that rather unsightly mess of ?s in your trigger patterns.
See if you cant tighten the patterns up a bit.
Hard to make suggestions without the corresponding MUD output.



The script fires when I check group after each round when it checks group to exact mud output is
Hit Points Mana Movement Align Exp needed Level
[ 6608/9103 ][ 8548/13623][ 2995/2995 ] [ 913] [ 15236865] [168 Cl] Alarenth

The only way I was able to pick up the numbers to correspond with my variables was to put those ? between them. Now as far as var=@var+1 I don't understand what you mean. It took me months to write this and am a amateur.. I only receive the lag when I input group
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3797
Location: Pensacola, FL, USA

PostPosted: Sun Jan 21, 2018 6:01 pm   
 
Code:
 Hit Points   Mana         Movement      Align   Exp needed    Level
[ 6608/9103 ][ 8548/13623][ 2995/2995 ] [  913] [   15236865] [168 Cl] Alarenth

Using the code tags will preserve spacing on the forum.
Code:
#TR {~[%s(%d)/(%d)%s~]~[%s(%d)/(%d)%s~]~[%s(%d)/(%d)%s~] ~[%s(%d)~] ~[%s(%d)~] ~[(%d) Cl~] (%w)} {
  storMPC=%1
  storMPM=%2
  $mana=%3
  $manaMax=%4
  $move=%5
  $moveMax=%6
  $align=%7
  $xpNeeded=%8
  $level=%9
  posManaTarget=%10
  }

This is how the trigger pattern should look... I have likely captured too much data, but it is all available to play with.
I put the stuff you are not currently using in $localVars just as an example.

As for:
var=(@var+1)
That is shorthand math, logically it means the same thing as:
#MATH var (@var+1)
But if I am correct about the #MATH command having issues, it would bypass them.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net