[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger/Delayed Output?

Trigger/Delayed Output?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Fri 07 Dec 2001 11:36 PM (UTC)
Message
I was wondering if there was a way to pause between casting. Like after you cast the first two spells. If you could pause for 4 seconds, then continue casting. This way your client could catch up with the server.

Trigger: * says 'spellup'

Send:
,is now casting on %1
c 'kindred strength' %1
<Pause here for 2 seconds>
c 'elven beauty' %1
<Pause here for 2 seconds>
c 'trollish vigor' %1
<Pause here for 2 seconds>
c 'valiance' %1
<Pause here for 2 seconds>
c 'fly' %1
,revs up the Turbo-Trancer 2000
,enters Turbo-Trance 1 of 2
<Pause here for 2 seconds>
trance
,enters Turbo-Trance 2 of 2
smile %1
<Pause here for 2 seconds>
,begins casting once more
c 'iceshield' %1
<Pause here for 2 seconds>
c 'fireshield' %1
<Pause here for 2 seconds>
c 'dragon wit' %1
<Pause here for 2 seconds>
c 'slink' %1
<Pause here for 2 seconds>
c 'sagacity' %1
<Pause here for 2 seconds>
,looks about for others to cast on!

Can that be done?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Storm Dragon   Denmark  (45 posts)  [Biography] bio
Date Reply #1 on Sat 08 Dec 2001 01:17 AM (UTC)

Amended on Tue 25 Dec 2001 05:48 PM (UTC) by Storm Dragon

Message
Following script is in VBScript, use at own risk




sub SD-spellup (strTriggerName, trig_line, arrWildCards)
' This subroutine is written in Visual Basic scripting for Mushclient
' to install type: /sd-spellup "Install" "" ""
' Use however you like, modify at own risk
' SD in all triggernames are used to ID the writter of this script
' Storm Dragon of Gammon Software Solutions forum at : www.mushclient.com

 select case ucase(strtriggername)
  case "INSTALL"
   world.addtrigger "SD-spelluptrigger", "* says 'spellup'", "", 1, -1, 0, "", "SD-spellup"
  case "SD-SPELLUPTRIGGER"
   world.setvariable "SD-Person", arrWildCards(1)
   world.addtrigger "SD-TooLate", "* says 'spellup'", "", 1, -1, 0, "", "SD-spellup"
   world.addtimer "SD-Commence-1", 0, 0, 1, "", 5, "SD-spellup"
  case "SD-TOOLATE"
   world.send "say Sorry " + arrwildcards(1) + " but I am already casting spells on " + world.getvariable("SD-Person") + " please be patient"
  case "SD-COMMENCE-1"
   world.send ",is now casting on " + world.getvariable("SD-PERSON")
   world.send "cast 'kindred strength' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-2", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-2"
   world.send "cast 'elven beauty' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-3", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-3"
   world.send "cast 'trollish vigor' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-4", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-4"
   world.send "cast 'valiance' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-5", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-5"
   world.send "cast 'fly' " + world.getvariable("SD-PERSON")
   world.send ",revs up the Turbo-Trancer 2000"
   world.send ",enters Turbo-Trance 1 of 2"
   world.addtimer "SD-Commence-6", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-6"
   world.send "trance"
   world.send ",enters Turbo-Trance 2 of 2"
   world.send "smile " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-7", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-7"
   world.send ",begins casting once more"
   world.send "cast 'iceshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-8", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-8"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-9", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-9"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-10", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-10"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-11", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-11"
   world.send "cast 'dragon wit' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-12", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-12"
   world.send "cast 'slink' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-13", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-13"
   world.send "cast 'sagacity' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-14", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-14"
   world.note "Done! Target has been spelled up!"
   world.send ",looks about for others to cast on!"
   world.deletetrigger "SD-TOOLATE"
   world.addtrigger "SD-spelluptrigger", "* says 'spellup'", "", 1, -1, 0, "", "SD-spellup"
  case else
   world.note "Incorrect usage, please read the comments of this subroutine"
 end select
end sub


Ooops! <:)

I had accidentally swapped the way world.getvariable() and world.setvariable looked..
I have fixed the above script, so it should now be correct
study it for a while to learn how things look and simply change to fit your 'bots'
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sun 09 Dec 2001 05:30 AM (UTC)
Message
You can save a bit of work by using "one-shot" timers, by using flag 4. The timer deletes itself after firing, thus removing the need for the "deletetimer" lines.

These flags are additive, so instead of using 1 (as you currently are) use 5 (1 + 4).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Reply #3 on Tue 25 Dec 2001 10:22 AM (UTC)
Message
Erm.. The above script needs a little bit of work.. I decided to try it and I got a bunkload of errors.. Nick, you were talking about one-shot timers or something? Could you take the above and clean it up?

I would like to use this and make other spelltriggers with it if you can..

This way I can create a kludged together spellbot script for MUSHClient, since all the ones that I got were for zMUD.

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Storm Dragon   Denmark  (45 posts)  [Biography] bio
Date Reply #4 on Tue 25 Dec 2001 05:48 PM (UTC)

Amended on Tue 25 Dec 2001 06:03 PM (UTC) by Storm Dragon

Message
Earlier post had loads of errors, I have edited and fixed them all I believe.

Oh, and thanks Nick, I dont think I noticed that you could make one-shot timers, can this be done with triggers too?
[Go to top] top

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Reply #5 on Tue 25 Dec 2001 10:59 PM (UTC)
Message
Thanks mate.. This should work fine.. I am going to try it now..

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Reply #6 on Tue 25 Dec 2001 11:01 PM (UTC)
Message
Error number: -2146827283
Event: Execution of line 23 column 7
Description: Expected '('
Called by: Immediate execution

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Wed 26 Dec 2001 12:24 AM (UTC)
Message
Quote:

Oh, and thanks Nick, I dont think I noticed that you could make one-shot timers, can this be done with triggers too?


No, the one-shot timers were for a single event (ie. do something in 5 seconds, not every 5 seconds).

I suppose a trigger could delete itself in a script, I'm not sure how successful that would be. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Storm Dragon   Denmark  (45 posts)  [Biography] bio
Date Reply #8 on Wed 26 Dec 2001 10:12 AM (UTC)
Message
Ok.. I tried loading the script into my copy of MC, no errors at all.. Make sure you erase the old and get every line I wrote when you copy it over in your scriptfile
[Go to top] top

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Reply #9 on Wed 26 Dec 2001 11:28 AM (UTC)
Message
sub PromptParse (strTriggerName, trig_line, arrWildCards)
  select case lcase(StrTriggerName)
    case "install"
      world.addtrigger "SendPrompt", "(*/*hp|*m|*mv)(*)<* coins>(#*)", "", 1, -1, 0, "", "PromptParse"
    case "sendprompt"             '    1 2   3  4    5  6         7  - These are the wildcards
      world.setvariable "CurrentHP", cint(arrWildCards(1))
      world.setvariable "MaxHP", cint(arrWildCards(2))
      world.setvariable "CurrentMana", cint(arrWildCards(3))
      world.setvariable "CurrentVitality", cint(arrWildCards(4))
      world.setvariable "CurrentCoins", arrWildCards(6)
    case else
  end select
' Below this line we can insert the subroutines that have to be checked everytime a prompt shows up.
  call ManaCheck
end sub

sub ManaCheck
  if world.getvariable("CurrentMana") <= world.getvariable("MinMana") then
    world.send "Restore Self"
  end if
end sub

sub SD-spellup (strTriggerName, trig_line, arrWildCards)
' This subroutine is written in Visual Basic scripting for Mushclient
' to install type: /sd-spellup "Install" "" ""
' Use however you like, modify at own risk
' SD in all triggernames are used to ID the writter of this script
' Storm Dragon of Gammon Software Solutions forum at : www.mushclient.com

 select case ucase(strtriggername)
  case "INSTALL"
   world.addtrigger "SD-spelluptrigger", "* says 'spellup'", "", 1, -1, 0, "", "SD-spellup"
  case "SD-SPELLUPTRIGGER"
   world.setvariable "SD-Person", arrWildCards(1)
   world.addtrigger "SD-TooLate", "* says 'spellup'", "", 1, -1, 0, "", "SD-spellup"
   world.addtimer "SD-Commence-1", 0, 0, 1, "", 5, "SD-spellup"
  case "SD-TOOLATE"
   world.send "say Sorry " + arrwildcards(1) + " but I am already casting spells on " + world.getvariable("SD-Person") + " please be patient"
  case "SD-COMMENCE-1"
   world.send ",is now casting on " + world.getvariable("SD-PERSON")
   world.send "cast 'kindred strength' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-2", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-2"
   world.send "cast 'elven beauty' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-3", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-3"
   world.send "cast 'trollish vigor' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-4", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-4"
   world.send "cast 'valiance' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-5", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-5"
   world.send "cast 'fly' " + world.getvariable("SD-PERSON")
   world.send ",revs up the Turbo-Trancer 2000"
   world.send ",enters Turbo-Trance 1 of 2"
   world.addtimer "SD-Commence-6", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-6"
   world.send "trance"
   world.send ",enters Turbo-Trance 2 of 2"
   world.send "smile " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-7", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-7"
   world.send ",begins casting once more"
   world.send "cast 'iceshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-8", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-8"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-9", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-9"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-10", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-10"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-11", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-11"
   world.send "cast 'dragon wit' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-12", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-12"
   world.send "cast 'slink' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-13", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-13"
   world.send "cast 'sagacity' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-14", 0, 0, 2, "", 5, "SD-spellup"
  case "SD-COMMENCE-14"
   world.note "Done! Target has been spelled up!"
   world.send ",looks about for others to cast on!"
   world.deletetrigger "SD-TOOLATE"
   world.addtrigger "SD-spelluptrigger", "* says 'spellup'", "", 1, -1, 0, "", "SD-spellup"
  case else
   world.note "Incorrect usage, please read the comments of this subroutine"
 end select
end sub


The above is all the code I have in the script file.. That's it.. All of it.. And I still get the error that I got above^^.. Just by letting MC rehash the config script, before I even type the install part.. Any idea?

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Wed 26 Dec 2001 09:10 PM (UTC)

Amended on Wed 26 Dec 2001 09:11 PM (UTC) by Nick Gammon

Message
The forum replaces backslashes in some cases (see "what are forum codes?") when you paste.

If you have forum codes turned on you (the person posting) might want to set:

[ to \[
] to \]
\ to \\

Then the posted code should come out exactly.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Reply #11 on Fri 28 Dec 2001 12:09 PM (UTC)
Message
Storm Dragon, did you do that? Because what I copied is what is there. I have to know if you did, because since I don't know one thing about VBScript, I am going to have to try to bumble my way through the code and attempt to make those change. Or you can repost it with the corrections so I don't waste days and not learn anything.

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Storm Dragon   Denmark  (45 posts)  [Biography] bio
Date Reply #12 on Tue 01 Jan 2002 12:11 PM (UTC)

Amended on Wed 02 Jan 2002 03:47 PM (UTC) by Storm Dragon

Message
sub PromptParse (strTriggerName, trig_line, arrWildCards)
  select case lcase(StrTriggerName)
    case "install"
      world.addtrigger "SendPrompt", "(*/*hp|*m|*mv)(*)<* coins>(#*)", "", 1, -1, 0, "", "PromptParse"
    case "sendprompt"             '    1 2   3  4    5  6         7  - These are the wildcards
      world.setvariable "CurrentHP", cint(arrWildCards(1))
      world.setvariable "MaxHP", cint(arrWildCards(2))
      world.setvariable "CurrentMana", cint(arrWildCards(3))
      world.setvariable "CurrentVitality", cint(arrWildCards(4))
      world.setvariable "CurrentCoins", arrWildCards(6)
    case else
  end select
' Below this line we can insert the subroutines that have to be checked everytime a prompt shows up.
  call ManaCheck
end sub

sub ManaCheck
  if world.getvariable("CurrentMana") <= world.getvariable("MinMana") then
    world.send "Restore Self"
  end if
end sub

sub SDspellup (strTriggerName, trig_line, arrWildCards)
' This subroutine is written in Visual Basic scripting for Mushclient
' to install type: /SDspellup "Install" "" ""
' Use however you like, modify at own risk
' SD in all triggernames are used to ID the writter of this script
' Storm Dragon of Gammon Software Solutions forum at : www.mushclient.com

 select case ucase(strtriggername)
  case "INSTALL"
   world.addtrigger "SDspelluptrigger", "* says 'spellup'", "", 1, -1, 0, "", "SDspellup"
  case "SDSPELLUPTRIGGER"
   world.setvariable "SD-Person", arrWildCards(1)
   world.addtrigger "SD-TooLate", "* says 'spellup'", "", 1, -1, 0, "", "SDspellup"
   world.addtimer "SD-Commence-1", 0, 0, 1, "", 5, "SDspellup"
  case "SD-TOOLATE"
   world.send "say Sorry " + arrwildcards(1) + " but I am already casting spells on " + world.getvariable("SD-Person") + " please be patient"
  case "SD-COMMENCE-1"
   world.send ",is now casting on " + world.getvariable("SD-PERSON")
   world.send "cast 'kindred strength' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-2", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-2"
   world.send "cast 'elven beauty' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-3", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-3"
   world.send "cast 'trollish vigor' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-4", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-4"
   world.send "cast 'valiance' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-5", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-5"
   world.send "cast 'fly' " + world.getvariable("SD-PERSON")
   world.send ",revs up the Turbo-Trancer 2000"
   world.send ",enters Turbo-Trance 1 of 2"
   world.addtimer "SD-Commence-6", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-6"
   world.send "trance"
   world.send ",enters Turbo-Trance 2 of 2"
   world.send "smile " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-7", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-7"
   world.send ",begins casting once more"
   world.send "cast 'iceshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-8", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-8"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-9", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-9"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-10", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-10"
   world.send "cast 'fireshield' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-11", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-11"
   world.send "cast 'dragon wit' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-12", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-12"
   world.send "cast 'slink' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-13", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-13"
   world.send "cast 'sagacity' " + world.getvariable("SD-PERSON")
   world.addtimer "SD-Commence-14", 0, 0, 2, "", 5, "SDspellup"
  case "SD-COMMENCE-14"
   world.note "Done! Target has been spelled up!"
   world.send ",looks about for others to cast on!"
   world.deletetrigger "SD-TOOLATE"
   world.addtrigger "SDspelluptrigger", "* says 'spellup'", "", 1, -1, 0, "", "SDspellup"
  case else
   world.note "Incorrect usage, please read the comments of this subroutine"
 end select
end sub


ok I found the error, I was not aware that you cant use '-' in sub names, dumb me, but now I know and I will not make that
mistake again
when you install this you better run the install part again
just to be sure that everything will work.
[Go to top] top

Posted by Elric   USA  (51 posts)  [Biography] bio
Date Reply #13 on Tue 01 Jan 2002 10:39 PM (UTC)
Message
Well the script parsed just fine when I had MUSHClient reload it.. But when I redid the install I got this error..

Error number: -2146827263
Event: Execution of line 1 column 21
Description: Expected end of statement
Called by: Immediate execution

"By the pricking of my thumbs, something wicked this way comes. Open locks, whoever knocks!" MacBeth, Shakespeare
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Wed 02 Jan 2002 04:25 AM (UTC)
Message
I would have thought the install line would need commas, eg.



/SDspellup "Install", "", ""

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


45,065 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]