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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger calling script to send multiple things

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger calling script to send multiple things

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Jcet   USA  (25 posts)  [Biography] bio
Date Sat 10 Nov 2001 07:12 PM (UTC)  quote  ]
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!
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 11 Nov 2001 03:45 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Jcet   USA  (25 posts)  [Biography] bio
Date Reply #2 on Sun 11 Nov 2001 07:30 AM (UTC)  quote  ]
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!
[Go to top] top

Posted by Jcet   USA  (25 posts)  [Biography] bio
Date Reply #3 on Sun 11 Nov 2001 07:46 AM (UTC)  quote  ]
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!
[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.


1,715 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]