[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]  General
. . -> [Subject]  Interesting problem...
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

Interesting problem...

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

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Wed 14 Sep 2005 08:27 AM (UTC)

Amended on Wed 14 Sep 2005 08:57 AM (UTC) by David Berthiaume

All right. Haven't been here in a while, and I can't quite figure out how to do this on my own, I've tried everything that I can think of. Perhaps I'm just missing it.

I have an alias called start

The script in the alias is quite simple.
Speedwalkdelay = "@CharacterInfoSpellSpeed"
for count = 1 to @CharacterInfoSpellCount
 Queue "c " & "@CharacterInfoSetSpell", True
The problem is I want at the end of the loop, I want it to queue up an execute to restart it.

I've tried, Execute "start" that doesn't work. then I realized that wouldn't queue it. So I tried...

Queue "" & Execute* "start", True

But I got an error saying that there was an expected end arguement or something thing...

Anyways, I'm baffled.

* Note, I did search the forums and I know about the Execute issue with VBscript, I went back and tried it with world.execute, but still no luck)
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #1 on Wed 14 Sep 2005 09:40 AM (UTC)
You want to queue an Execute call? Don't think that'll work at all. Speedwalk text is treated pretty much the same way world.Send is, so trying to execute an alias from the speedwalk by trying to make it perform an Execute call won't work. What you can do though is define some standard prefix for speedwalk commands that are actually aliases, and then use OnPluginSend callback to catch these commands and redirect them to world.Execute.

Something like "SpeedwalkExec:*", where * is replaced by the command you want executed. Then have a plugin sitting there with:

dim exec_command
set exec_command = new RegExp
exec_command.pattern = "(SpeedwalkExec\:)(.*)"

function OnPluginSend(strText)
   set Matches = exec_command.execute(strText)
   set Match = Matches(0)
   if Match.SubMatches(0) = "SpeedwalkExec:" then
      world.Execute Match.SubMatches(1)
      OnPluginSend = vbFalse
      OnPLuginSend = vbTrue
   end if
end function

Or better yet, use something with string slicing. Lua will do:

function OnPluginSend(strText)
   if string.sub(strText, 1, 14) == "SpeedwalkExec:" then
     Execute(string.sub(strText, 15, -1)
     return false
     return true


Then you just need to add "SpeedwalkExec:start" to the end of the queue to have it call an alias.

[Go to top] top

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Reply #2 on Fri 16 Sep 2005 09:51 AM (UTC)
I solved the problem, not the way I wanted too, but I did. I would prefer to do it all in one alias instead of relying on a queued say to set off a trigger.

Unfortunately I am not very well versed in using plugins, infact, I don't have the slightest damned idea how to do what you suggested.
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #3 on Fri 16 Sep 2005 02:18 PM (UTC)
The way I make "one-shot" plugins like that is start a new empty world. Open File->Plugin Wizard. Fill in the first form, then uncheck all options on all tabs, go to the Script tab, select the language, copy/paste my tiny script in there. Save. Go to my main world and install the saved plugin there.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #4 on Fri 16 Sep 2005 06:09 PM (UTC)
Or you could use a DoAfterSpecial, to call a script.

The queue will not work though, since it just sends to the world (no interpretation).


Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Reply #5 on Fri 16 Sep 2005 11:12 PM (UTC)
Did exactly what you said, made new world, created the plugin, and got this:

Error number: -2146828283
Event: Execution of line 7 column 4
Description: Invalid procedure call or argument
Called by: Function/Sub: OnPluginSend called by Plugin SpeedwalkExecute
Reason: Executing plugin SpeedwalkExecute sub OnPluginSend
[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.


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.


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]