this is further to this thread:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1661
the script there worked, but not always correctly because it could fire at the wrong time depending on when the spell was cast initially (when cast right before a tick caused the message to fire just after the spell had fallen), so I have done a new one that is far more accurate, however I'm getting 2 script errors that say:
Wrong number of arguements for script subroutine "aegis_warn" when processing timer "aegistimerB"
We expected your subroutine to have 1 arguement
and
Wrong number of arguements for script subroutine "aegis_counter" when processing timer "aegistimerA"
We expected your subroutine to have 1 arguement
I know it's something really basic I've messed up in the syntax, but here is what I have..
I have 2 variables named:
aegis
aegislength
the aegislength variable is a constant as I know the aegis spell lasts a maximum of 5 ticks (or if you cast it right at the end of a tick, then it lasts 4 ticks plus a few seconds, which caused the problem with the original script)
when I cast the spell, a trigger is fired called aegis_activated:
sub aegis_activated (thename, theoutput, thewildcards)
dim aegisval
aegisval = World.GetVariable ("aegislength")
World.SetVariable "aegis", aegisval
end sub
..that's works fine. (The reason for aegislength being variable is that sometimes in a group I will have someone else casting aegis spells on me, and their aegis length may be up to 7 ticks long). Next I have 2 timers named aegistimerA and aegistimerB.
The aegistimerA fires on every tick with no offset, and calls a script named aegis_counter.
The aegistimerB fires on every tick with an offset of 25 seconds, and call a script named aegis_warn.
These are the scripts (subroutines) that are being called:
sub aegis_counter (thename, theoutput, thewildcards)
dim aegis
dim aegisnew
aegis = World.GetVariable ("aegis")
aegisnew = aegis - 1
if aegis > 0 then
World.SetVariable "aegis", aegisnew
end if
end sub
Effectively, this is counting down the ticks left on the spell until it gets to 0. Here's the other subroutine:
sub aegis_warn (thename, theoutput, thewildcards)
dim aegisvalue
aegisvalue = World.GetVariable ("aegis")
if aegisvalue = 1 then
World.send "grouptell aegis falling on tick"
end if
end sub
All this one is doing is 25 seconds before a tick is due, it looks at the variable 'aegis' and warns me that the spell is about to drop if the value of 'aegis' is 1 (1 tick left)..
This all seems fairly logical to me, and I'm guessing the errors thrown are something to do with the syntax used.. can you point me in the right direction?
Oh, if it makes any difference, both timers are reset periodically by MUD messages that appear on ticks, so they dont get out of synch.
As an afterthought, I vaguely remember something about vbs not recognising 0 as a value.. would that be it?
Look forward to your reply.
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1661
the script there worked, but not always correctly because it could fire at the wrong time depending on when the spell was cast initially (when cast right before a tick caused the message to fire just after the spell had fallen), so I have done a new one that is far more accurate, however I'm getting 2 script errors that say:
Wrong number of arguements for script subroutine "aegis_warn" when processing timer "aegistimerB"
We expected your subroutine to have 1 arguement
and
Wrong number of arguements for script subroutine "aegis_counter" when processing timer "aegistimerA"
We expected your subroutine to have 1 arguement
I know it's something really basic I've messed up in the syntax, but here is what I have..
I have 2 variables named:
aegis
aegislength
the aegislength variable is a constant as I know the aegis spell lasts a maximum of 5 ticks (or if you cast it right at the end of a tick, then it lasts 4 ticks plus a few seconds, which caused the problem with the original script)
when I cast the spell, a trigger is fired called aegis_activated:
sub aegis_activated (thename, theoutput, thewildcards)
dim aegisval
aegisval = World.GetVariable ("aegislength")
World.SetVariable "aegis", aegisval
end sub
..that's works fine. (The reason for aegislength being variable is that sometimes in a group I will have someone else casting aegis spells on me, and their aegis length may be up to 7 ticks long). Next I have 2 timers named aegistimerA and aegistimerB.
The aegistimerA fires on every tick with no offset, and calls a script named aegis_counter.
The aegistimerB fires on every tick with an offset of 25 seconds, and call a script named aegis_warn.
These are the scripts (subroutines) that are being called:
sub aegis_counter (thename, theoutput, thewildcards)
dim aegis
dim aegisnew
aegis = World.GetVariable ("aegis")
aegisnew = aegis - 1
if aegis > 0 then
World.SetVariable "aegis", aegisnew
end if
end sub
Effectively, this is counting down the ticks left on the spell until it gets to 0. Here's the other subroutine:
sub aegis_warn (thename, theoutput, thewildcards)
dim aegisvalue
aegisvalue = World.GetVariable ("aegis")
if aegisvalue = 1 then
World.send "grouptell aegis falling on tick"
end if
end sub
All this one is doing is 25 seconds before a tick is due, it looks at the variable 'aegis' and warns me that the spell is about to drop if the value of 'aegis' is 1 (1 tick left)..
This all seems fairly logical to me, and I'm guessing the errors thrown are something to do with the syntax used.. can you point me in the right direction?
Oh, if it makes any difference, both timers are reset periodically by MUD messages that appear on ticks, so they dont get out of synch.
As an afterthought, I vaguely remember something about vbs not recognising 0 as a value.. would that be it?
Look forward to your reply.