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 ➜ Interesting problem...

Interesting problem...

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


Posted by David Berthiaume   (202 posts)  Bio
Date Wed 14 Sep 2005 08:27 AM (UTC)

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

Message
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
next
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)
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Wed 14 Sep 2005 09:40 AM (UTC)
Message
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
   else
      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
   else
     return true
   end
end

end

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

Top

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #2 on Fri 16 Sep 2005 09:51 AM (UTC)
Message
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.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #3 on Fri 16 Sep 2005 02:18 PM (UTC)
Message
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.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #4 on Fri 16 Sep 2005 06:09 PM (UTC)
Message
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).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #5 on Fri 16 Sep 2005 11:12 PM (UTC)
Message
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
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.


20,762 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.