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 ➜ Bug reports ➜ Possible setcommand problem...

Possible setcommand problem...

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


Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Thu 29 May 2003 11:02 PM (UTC)
Message
I am using the following:

<aliases>
  <alias
   name="TwiCast"
   script="Flagcast"
   match="tf *"
   enabled="y"
  >
  </alias>
</aliases>

sub Flagcast (AName, Output, Wildcards)
  dim Teststr
  Teststr = Trim(Wildcards(1))
  world.note getcommand '*****
  if Teststr <> "koryo" and Teststr <> "slave" then
    if AName = "Flagcast" then
      world.setcommand "lig"
      world.send "flag " & Teststr
      world.send "lightning " & Teststr
    else
      world.setcommand "twi"
      world.send "flag " & Teststr
      world.send "twister " & Teststr
    end if
  else
    world.note "Oops, you almost attacked your slave!!!"
  end if
end sub


The ***** line was to test to see what was going on. Seems that Mushclient is doing this:

1. You type command and hit enter.
2. Client clears the input window.
3. Client processes the alias and calls the script.
4. Script tries to use setcommand, but fails since it still thinks 'tf somemob' is in there.
5. Client finally gets around to blanking its internal memory of the command.

I am guessing that instead of checking to see if the actually 'input' window is blank it is instead checking a variable that it uses to execute additional aliases/commands? This kind of makes 'setcommand' a bit pointless.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 30 May 2003 08:30 AM (UTC)
Message
Actually, without actually looking at the source, I think it is simpler than that:

a) You type the command
b) The client processes the command
c) After it is processed, the command window is cleared (unless 'repeat command' is set)

- Nick Gammon

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

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #2 on Fri 30 May 2003 05:19 PM (UTC)
Message
Hmm. I see. Hard to tell since you also don't see the sent commands until after the script exits. In any case it didn't exactly do what I was expecting. :p In theory, once you hit enter the command is no longer pending, but being executed, so the command line should be empty. The only way around this would be to push the command onto the history list, but you would likely get a duplicate entry and makes no particular logical sense. I think it is backwards imho.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 01 Jun 2003 04:47 AM (UTC)
Message
Why would you get a duplicate? The original one would be pushed, and the new one would replace it.

- Nick Gammon

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

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #4 on Sun 01 Jun 2003 05:21 AM (UTC)
Message
Umm. Not real clear what order things work in. I can see two possibilities:

>Command typed.
Processing.
--Push command.
--Place new command.
----Client places command in history.

>Command typed.
Processing.
--Push command.
--Place new command.
----Client sees command already in history and discard the duplicate.

Also, if you push it, then does it still run through additional aliases if more than one matches and you allow it? You see the problem? Besides I set up a temporary one shot timer to do it, which works, assuming I can get used to not retyping the command it feeds me. ;) lol
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Sun 01 Jun 2003 08:49 AM (UTC)
Message
I'm not at my development PC right now, but what I think it does is:

a) pull the command from the command window when the <enter> key is pressed

b) process it

c) push the command it processed (not whatever might now be in the command window) into the command history

d) clear the command window (?) But I might be wrong about that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


14,842 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.