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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Script and a problem sending a lot of things to the mud
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Script and a problem sending a lot of things to the mud

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


Posted by Gore   (207 posts)  [Biography] bio
Date Sun 04 Apr 2004 11:14 AM (UTC)
Message
Hey what's up, I've got this script to scroll through a list of things I have in my inventory (corpses), record the numbers of them, then do spam offer (corpse) searching through an array. Here's my code:

Quote:
<aliases>
  <alias
   script="corpse_start"
   match="^offer\:all$"
   enabled="y"
   group="script-offer"
   regexp="y"
   ignore_case="y"
   keep_evaluating="y"
   sequence="100"
  >
  </alias>
</aliases>

<triggers>
  <trigger
   custom_colour="17"
   group="script-offer"
   keep_evaluating="y"
   match="^\&quot;(.*?)\&quot;(\s+)the corpse of"
   name="corpse_trigger"
   regexp="y"
   script="corpse_add"
   sequence="100"
   other_text_colour="gray"
   other_back_colour="white"
  >
  </trigger>
  <trigger
   group="script-offer"
   keep_evaluating="y"
   match="^You are wearing\:$"
   name="offer_prompt"
   regexp="y"
   script="corpse_offer"
   sequence="100"
  >
  </trigger>
</triggers>

Dim Corpses()
Redim Corpses(0)

Sub Corpse_start (a,b,wildcard)
  World.Send "config pagelength 250"
  World.Send "ii corpse"
  World.EnableTrigger "corpse_trigger", TRUE
  World.EnableTrigger "offer_prompt", TRUE
End Sub

Sub Corpse_add (a,b,wildcard)
  ub = ubound(Corpses)
  If ub = 0 and isempty(Corpses) then
    Corpses(0) = wildcard(1)
  Else
    redim Preserve Corpses(ub+1)
    Corpses(ub+1) = wildcard(1)
  End If
End Sub  

Sub Corpse_offer (a,b,wildcard)
  World.ColourNote "black", "white", "-Offering corpses-"
  ub = ubound(corpses)
  For i = 1 to ub step 1
    World.Send "offer " & Corpses(i)
  Next
  World.EnableTrigger "corpse_trigger", FALSE
  World.EnableTrigger "offer_prompt", FALSE
  World.Send "config pagelength 20"
  redim Preserve Corpses(0)
End Sub



Which works fine and dandy, except if I have a lot of corpses, like 20 or so corpses, in which it'll offer up 15 or so corpses, then stop. And I'll have to send something through. Here's the output on the next post:
[Go to top] top

Posted by Gore   (207 posts)  [Biography] bio
Date Reply #1 on Sun 04 Apr 2004 11:15 AM (UTC)
Message
Quote:
828h, 2532m cexdb-Your current pagelength: 250
3828h, 2532m cexdb-You aren't wielding anything in either hand.
You are holding:
"hare237746"        the corpse of a rheodine hare
"swarm126730"       the corpse of a swarm of mosquitoes
"swarm121051"       the corpse of a swarm of mosquitoes
"hare237759"        the corpse of a rheodine hare
"lynx133641"        the corpse of a forest lynx
"swarm118439"       the corpse of a swarm of mosquitoes
"hare231010"        the corpse of a rheodine hare
"swarm144098"       the corpse of a swarm of mosquitoes
"lynx174125"        the corpse of a forest lynx
"swarm54085"        the corpse of a swarm of mosquitoes
"cormorant13214"    the corpse of a double-crested cormorant
"hare237803"        the corpse of a rheodine hare
"hare217573"        the corpse of a rheodine hare
"hare210583"        the corpse of a rheodine hare
"lynx171258"        the corpse of a forest lynx
"hare237788"        the corpse of a rheodine hare
"cormorant128254"   the corpse of a double-crested cormorant
"cormorant56941"    the corpse of a double-crested cormorant
"cormorant226050"   the corpse of a double-crested cormorant
"sandpiper237725"   the corpse of a little sandpiper
"hare219816"        the corpse of a rheodine hare
"cormorant222063"   the corpse of a double-crested cormorant
"cormorant139721"   the corpse of a double-crested cormorant
"cormorant17137"    the corpse of a double-crested cormorant
You are wearing:
-Offering corpses-
3828h, 2532m cexdb-You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-You offer up the corpse of a swarm of mosquitoes to Lupus, Wild God of the 
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a swarm of mosquitoes to Lupus, Wild God of the 
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a forest lynx to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a swarm of mosquitoes to Lupus, Wild God of the 
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a swarm of mosquitoes to Lupus, Wild God of the 
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a forest lynx to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a swarm of mosquitoes to Lupus, Wild God of the 
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a forest lynx to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a little sandpiper to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a rheodine hare to Lupus, Wild God of the Beasts.
3828h, 2532m cexdb-What is it you wish to offer?


So it just stopped (I wish I was echoing my commands for this..) then I had to start the script again, here's the output:

Quote:
You aren't wielding anything in either hand.
You are holding:
"cormorant222063"   the corpse of a double-crested cormorant
"cormorant139721"   the corpse of a double-crested cormorant
"cormorant17137"    the corpse of a double-crested cormorant
You are wearing:
3828h, 2532m cexdb-Your current pagelength: 250
3828h, 2532m cexdb-You aren't wielding anything in either hand.
You are holding:
"cormorant222063"   the corpse of a double-crested cormorant
"cormorant139721"   the corpse of a double-crested cormorant
"cormorant17137"    the corpse of a double-crested cormorant
You are wearing:
-Offering corpses-
3828h, 2532m cexdb-You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-
You offer up the corpse of a double-crested cormorant to Lupus, Wild God of the
Beasts.
3828h, 2532m cexdb-
Your current pagelength: 20
[/qoute]

Any ideas?
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #2 on Mon 05 Apr 2004 04:11 AM (UTC)
Message
The script looks fine, my guess that it has to do with the mud. Sometimes if you spam commands very fast it will concatenate them, e.g.:


world.send "outr thing"
world.send "outr thing"
...
world.send "outr thing"


comes out as:


"outr thingoutrthingoutrthi"
"ng"
"outr thing"


at some point in the sequence. This is what could be happening. You can try sending commands through a speedwalk with a small delay - about 100ms should be enough to keep the commands separate.
[Go to top] top

Posted by Gore   (207 posts)  [Biography] bio
Date Reply #3 on Mon 05 Apr 2004 09:40 AM (UTC)
Message
oo thanks, how do I do that tho? World.DoAfterSpecial would still spam through the for next though
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #4 on Mon 05 Apr 2004 01:33 PM (UTC)
Message
check the following callbacks in Mushclient's help:

world.SpeedwalkDelay
world.Queue
world.DiscardQueue
[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.


5,626 views.

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 FutureQuest]