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 ➜ help with an alias/trigger

help with an alias/trigger

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


Posted by Perrin   USA  (31 posts)  Bio
Date Sun 03 Feb 2008 03:51 AM (UTC)

Amended on Sun 03 Feb 2008 05:48 AM (UTC) by Perrin

Message
any help you could give would be helpful i cant seem to get this to work i keep getting this error
____________________________________________________________
Execution of line 2 column 113
Immediate execution
Expected end of statement
____________________________________________________________
<aliases>
<alias
match="^(add trigger(s|)|addtrigger(s|))$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.addtrigger ""&amp;getvariable ("asv1")&amp;"3", ""&amp;getvariable ("asv4")&amp;"", "world.enabletrigger \""&amp;getvariable ("asv1")&amp;"1", 1", 1, -1, 0, " ", " ", 12, 100

world.addtrigger ""&amp;getvariable ("asv1")&amp;"2", ""&amp;getvariable ("asv3")&amp;"", "world.enabletrigger ""&amp;getvariable ("asv1")&amp;"1", 0 ", 1, -1, 0, " ", " " , 12, 100

world.addtrigger ""&amp;getvariable ("asv1")&amp;"1", "^You flex your muscles proudly\!$", "c "&amp;getvariable ("asv2")&amp;"", 33, -1, 0, "", "", 12, 100</send>
</alias>
</aliases>

aardwolf player
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 03 Feb 2008 08:51 AM (UTC)

Amended on Sun 03 Feb 2008 08:56 AM (UTC) by Nick Gammon

Message
Expanding out the XML, your script reads:


world.addtrigger ""&getvariable ("asv1")&"3", ""&getvariable ("asv4")&"", "world.enabletrigger \""&getvariable ("asv1")&"1", 1", 1, -1, 0, " ", " ", 12, 100

world.addtrigger ""&getvariable ("asv1")&"2", ""&getvariable ("asv3")&"", "world.enabletrigger ""&getvariable ("asv1")&"1", 0 ", 1, -1, 0, " ", " " , 12, 100

world.addtrigger ""&getvariable ("asv1")&"1", "^You flex your muscles proudly\!$", "c "&getvariable ("asv2")&"", 33, -1, 0, "", "", 12, 100


I don't understand what you are trying to do here. For example:


""&getvariable ("asv4")&""


This is concatenating an empty string with the contents of variable asv4 and then adding another empty string to the end. Why are you doing this? Why not just say:


getvariable ("asv4")


If you look at the help for AddTrigger:

http://www.gammon.com.au/scripts/doc.php?function=AddTrigger

The various arguments are:


  • TriggerName
  • MatchText
  • ResponseText
  • Flags
  • Colour
  • Wildcard
  • SoundFileName
  • ScriptName


I don't see what you are supplying is supposed to do - there seems to be too many quotes there or something.

As far as I can make out, you are doing:


  • TriggerName --> ""&getvariable ("asv1")&"3"
  • MatchText --> ""&getvariable ("asv4")&""
  • ResponseText --> "world.enabletrigger \""&getvariable ("asv1")&"1", 1"
  • Flags --> 1
  • Colour --> -1
  • Wildcard --> 0
  • SoundFileName --> " "
  • ScriptName --> " "


Then you have 2 extra arguments:


12, 100


Did you mean to use AddTriggerEx?

http://www.gammon.com.au/scripts/doc.php?function=AddTriggerEx

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 03 Feb 2008 08:57 AM (UTC)
Message
You are not consistent with your use of world.something. The "world." part is not required, so either use it everywhere, or nowhere. Using it partly is confusing.

For example you use world.addtrigger but not world.getvariable .

- Nick Gammon

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

Posted by Perrin   USA  (31 posts)  Bio
Date Reply #3 on Sun 03 Feb 2008 09:17 AM (UTC)
Message
yes i did mean addtriggerex i already changed it in my alias but didn't edit it here
and i was under the impression the " " were needed

what im tring to do is my first alias capture var1 var2
and send commands causing triggers to capture var3 var4

and this alias to create a set of triggers out of them

aardwolf player
Top

Posted by Perrin   USA  (31 posts)  Bio
Date Reply #4 on Sun 03 Feb 2008 09:19 AM (UTC)

Amended on Sun 03 Feb 2008 10:01 AM (UTC) by Perrin

Message
ok my only question is this why does this function
addtriggerex ""&amp;getvariable ("asv1")&amp;"3", ""&amp;getvariable ("asv4")&amp;"", "enabletrigger &amp;quot;"&amp;getvariable("asv")&amp;"1&amp;quot;, 1", 1, -1, 0, "", "", 12, 100

create this trigger?
<triggers>
<trigger
enabled="y"
match="The gold in your pocket disappears."
name="detg3"
send_to="12"
sequence="100"
variable="detg3"
>
<send>enabletrigger &amp;quot;1&amp;quot;, 1</send>
</trigger>
</triggers>
____________________________________________________________
and now for some reason my scripting is disabled and in can't turn it back on i keep getting the same error msg
Script error
World: aardwolf
Execution of line 1 column 1
Immediate execution
Expected statement
Line in error:
<?xml version="1.0" encoding="UTF-8"?>

aardwolf player
Top

Posted by Perrin   USA  (31 posts)  Bio
Date Reply #5 on Sun 03 Feb 2008 10:38 AM (UTC)
Message
nevermind i feel like an idiot i was calling "asv" as my variable instead of "asv1"

aardwolf player
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.


23,829 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.