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 ➜ VBscript ➜ more vb script help

more vb script help

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


Pages: 1  2 

Posted by Shou   USA  (30 posts)  Bio
Date Reply #15 on Thu 27 May 2010 03:55 AM (UTC)

Amended on Thu 27 May 2010 04:00 AM (UTC) by Shou

Message
ok, i know this is somewhere here, but i can't find it. This is what i have right now:

<aliases>
  <alias
   match="tdart *"
   enabled="y"
   expand_variables="y"
   sequence="100"
  >
  <send>twinshot @npc %1</send>
  </alias>
</aliases>


is there a way to make this work, when the * might not be there? the * is replacing a direction, btw.

My computer once beat me at chess, but it was no match for me at kickboxing.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #16 on Thu 27 May 2010 05:44 AM (UTC)
Message
Template:faq=50 Please read the MUSHclient FAQ - point 50.

- Nick Gammon

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

Posted by Shou   USA  (30 posts)  Bio
Date Reply #17 on Thu 03 Jun 2010 04:02 AM (UTC)
Message
ok, looks like i need some help here. i have an alias that helps me preserve toxins, and this is what i have:

<aliases>
  <alias
   match="preserve"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="1"
  >
  <send>if getvariable ("toxinstorage") = ("0") then
world.send "preserve toxin in vial"
world.SetVariable "toxinstorage", "1"
end if
if getvariable ("toxinstorage") = ("1") then
world.send "preserve toxin in vial"
world.SetVariable "toxinstorage", "2"
end if
if getvariable ("toxinstorage") = ("2") then
world.send "preserve toxin in vial"
world.send "drop vial"
world.SetVariable "toxinstorage", "0"
end if</send>
  </alias>
</aliases>


although i have this, it sends

preserve toxin in vial
preserve toxin in vial
preserve toxin in vial
drop vial

each time it is used. did i mess something up in the function?

My computer once beat me at chess, but it was no match for me at kickboxing.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #18 on Thu 03 Jun 2010 04:32 AM (UTC)
Message
Well, yes.

You start off like this:


if getvariable ("toxinstorage") = ("0") then
  world.send "preserve toxin in vial"
  world.SetVariable "toxinstorage", "1"
end if


So now the variable "toxinstorage" is 1.

Then immediately afterwards you test if it is 1 (which it is, now):


if getvariable ("toxinstorage") = ("1") then
  world.send "preserve toxin in vial"
  world.SetVariable "toxinstorage", "2"
end if


So you do that as well. Then you set the variable to 2. Then you test if it is 2 (which it is now). You need to use "else" to stop all the ifs succeeding at once.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #19 on Thu 03 Jun 2010 04:35 AM (UTC)

Amended on Thu 03 Jun 2010 06:36 AM (UTC) by Nick Gammon

Message
One way would be to use "expand variables" as that is done at the start (by which I mean, once the variables are expanded, they don't change during the running of the script). Something like this:


if @toxinstorage = 0 then
  Send "preserve toxin in vial"
  SetVariable "toxinstorage", "1"
end if

if @toxinstorage = 1 then
  Send "preserve toxin in vial"
  SetVariable "toxinstorage", "2"
end if

if @toxinstorage = 2 then
  Send "preserve toxin in vial"
  Send "drop vial"
  SetVariable "toxinstorage", "0"
end if

- Nick Gammon

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

Posted by Shou   USA  (30 posts)  Bio
Date Reply #20 on Thu 03 Jun 2010 05:07 AM (UTC)

Amended on Thu 03 Jun 2010 05:10 AM (UTC) by Shou

Message
thanks! i never would have figured this out alone

My computer once beat me at chess, but it was no match for me at kickboxing.
Top

Posted by Shou   USA  (30 posts)  Bio
Date Reply #21 on Fri 25 Jun 2010 03:44 AM (UTC)
Message
ok, i have a problem. i just recently made the alias bf, which does this (Sorry for the length):

<aliases>
  <alias
   match="bf"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>if getvariable ("stance") = ("Gyanis") and getvariable ("surge") = ("off") then
if @stance = Gyanis and @surge = off then
world.execute "change stance vae-sant"
end if
if getvariable ("stance") = ("Vae-Sant") and getvariable ("surge") = ("off") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
end if
if getvariable ("stance") = ("Rizet") and getvariable ("surge") = ("off") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
end if
if getvariable ("stance") = ("Laesan") and getvariable ("surge") = ("off") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
end if
if getvariable ("stance") = ("Ein-Fasit") and getvariable ("surge") = ("off") then
world.send "sitara butterfly @npc"
world.send "Trip @npc"
world.send "pindown @npc"
end if
if getvariable ("stance") = ("Gyanis") and getvariable ("surge") = ("on") then
world.execute "change stance vae-sant"
end if
if getvariable ("stance") = ("Vae-Sant") and getvariable ("surge") = ("on") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
world.send "mindumb @npc"
end if
if getvariable ("stance") = ("Rizet") and getvariable ("surge") = ("on") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
world.send "mindumb @npc"
end if
if getvariable ("stance") = ("Laesan") and getvariable ("surge") = ("on") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
world.send "mindumb @npc"
end if
if getvariable ("stance") = ("Ein-Fasit") and getvariable ("surge") = ("on") then
world.send "sitara butterfly @npc"
world.send "trip @npc"
world.send "pindown @npc"
world.send "mindumb @npc"
End if</send>
  </alias>
</aliases>


now, when i try to fire it, it gives me this:

Script error
World: imperian
Execution of line 51 column 7
Immediate execution
Expected 'End'
Line in error:
end if

even though i don't have anything in column 7 line 51 (last line, the column after the 'f' in if), no spaces, nothing.

My computer once beat me at chess, but it was no match for me at kickboxing.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #22 on Fri 25 Jun 2010 04:06 AM (UTC)

Amended on Fri 25 Jun 2010 04:09 AM (UTC) by Twisol

Message
I bet you this isn't what you wanted:

if @stance = Gyanis and @surge = off then


It'll treat Gyanis and off as VBscript variables, not string values. Also, @stance's value will be unquoted. Did you mean:

if "@stance" = "Gyanis" and "@surge" = "off" then



EDIT: Also, you have these lines as the first two lines:

if getvariable ("stance") = ("Gyanis") and getvariable ("surge") = ("off") then
if @stance = Gyanis and @surge = off then


I don't see a matching 'end if' for the first one. Methinks one of those is redundant. If you -did- mean to do that - even though the intent of the checks are exactly the same - add another "end if" to the end of the script (or wherever it's supposed to go).

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Shou   USA  (30 posts)  Bio
Date Reply #23 on Fri 25 Jun 2010 05:51 AM (UTC)
Message
ah yes. i didn't notice those first two lines. thanks for the help

My computer once beat me at chess, but it was no match for me at kickboxing.
Top

Posted by Shou   USA  (30 posts)  Bio
Date Reply #24 on Mon 05 Jul 2010 09:37 AM (UTC)

Amended on Mon 05 Jul 2010 09:38 AM (UTC) by Shou

Message
ok, this time, i am trying to highlight a line that comes in with a group like this:

      Oramashi - Victory Circle               (590) - City of Antioch.
          Rait - Kinsarmar Crossroads         (103) - City of Kinsarmar.
          Ramm - The Mounted Cephyreid      (15186) - Ithaquan Council.


how would iget the Rait - Kinsarmar crossroads line highlighted, with 'Rait' as a wildcard?

oh, and the area before the names is just empty space.

My computer once beat me at chess, but it was no match for me at kickboxing.
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.


90,518 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.