Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Trigger calling script to send multiple things

Trigger calling script to send multiple things

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


Posted by Jcet   USA  (25 posts)  Bio
Date Sat 10 Nov 2001 07:12 PM (UTC)
Message
I cant get a trigger to work...... or atleast send it multiple times
trigger:
"( *) * is here."
script:
sub OnIG (Triggername, triggerline, arrWildCards)
Dim Sense
world.SetVariable "itemget", sense (Ubound (sense))
world.send "get " + world.getvariable ("itemget")
End Sub

i need the trigger to send the line depending on the number in the first wildcard... IE

(28) a Scouter is here.

i need it to split the first wild card(28) and send the like 28 times

if u cant understand what im sayin(I hardly do) then ill try to make it easier to understand.

-Jcet
See no good, hear no good, be no good, kill all good!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 11 Nov 2001 03:45 AM (UTC)
Message
First question, does the trigger fire at all? You can tell this by getting it to colour the trigger line, and if it turns a different colour (say, red), then you know it fired.

If not, you might need to get rid of that space after the first bracket. ie. make it:


(*) * is here.


As for the script, I would do it a bit differently, like this:


sub OnIG (Triggername, triggerline, arrWildCards) 
Dim i
  For i = 1 to arrWildCards (1)
   World.Send "get " & arrWildCards (2)
  next
End Sub


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Jcet   USA  (25 posts)  Bio
Date Reply #2 on Sun 11 Nov 2001 07:30 AM (UTC)
Message
No you see, i need to combine those, the trigger works by itself
but i need it to multiply by how many is there, but it also needs to split it

ie
( 3) Android Eightteen's Pearl Necklace is here.

it wont match on to the whole name, you have to get get eighteen, or necklace
i need it too split it, AND multiply it
and the space thats there, ya ur right i should take it out cos thats where the second digit goes if there is one

-Jcet
See no good, hear no good, be no good, kill all good!
Top

Posted by Jcet   USA  (25 posts)  Bio
Date Reply #3 on Sun 11 Nov 2001 07:46 AM (UTC)
Message
sub OnIG (Triggername, triggerline, arrWildCards)
Dim Sense
Sense = split (arrWildCards (2))
world.SetVariable "itemget", Sense (ubound (Sense))
Dim i
For i = 1 to arrWildCards (1)
World.Send "get " + world.getvariable ("itemget")
next
End Sub

turns out thats how u do what i just asked, toyed with it and got it to work 5 mins after i just posted ;)

-Jcet
See no good, hear no good, be no good, kill all good!
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.


13,305 views.

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

Go to topic:           Search the forum


[Go to top] top

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