[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  missing sub help please

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: missing sub help please
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Wed 25 Jul 2012 03:07 AM (UTC)  quote  ]
Message
The XML sequence " will become a quote sign once that is imported into the client.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Notaskixa   (5 posts)  [Biography] bio
Date Tue 24 Jul 2012 04:18 AM (UTC)  quote  ]

Amended on Tue 24 Jul 2012 04:21 AM (UTC) by Notaskixa

Message
Not sure if this thread is dead or how correct my assumptions are but seems to me Perrin is only using a few aliases in total and about 3-5 triggers per spell to track certain things such as:

the cast was successful, the affect is active, the affect wore off, the cast failed, and if the cast failed to recast.

Seems he is only using the alias in the original post to cause the enabled triggers to fire (only makes sense to me that way at least) instead of causing all the spells to cast. But i have no idea how to make the client add triggers to a plugin if that's what he's trying to do.

Nick didn't think he could use tables unless he switches to Lua.

Just trying to clarify something that was mentioned on the thread wouldn't " translate out to " since " translates to " but don't really see a reason to use it unless for personal readability
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Tue 30 Nov 2010 01:17 AM (UTC)  quote  ]
Message
It's feasible - I did a spellups plugin myself a while back.

But I think the idea of adding thousands of triggers (or aliases) isn't the way to do it. It just gets confusing.

I suspect that you are taking a tintin approach (or maybe you are used to another client) where you typically have a file which loads up lots of aliases from a big list.

Just as an example, say you were planning to do lots of spellups, and as each new spell was learnt you added a new alias, eg.


spellup heal
spellup major heal
spellup cure light
spellup cure heavy


Well personally, instead of adding dozens of aliases I would have one alias with a wildcard, eg.


spellup *


Then you look up the wildcard (ie. %1 in the alias send window) and see if you know that spell, and if so, cast it.

Then you just need a database (table) of spells you know, rather than a database of aliases. It's just simpler and easier to understand.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Perrin   USA  (31 posts)  [Biography] bio
Date Tue 30 Nov 2010 12:45 AM (UTC)  quote  ]

Amended on Tue 30 Nov 2010 12:58 AM (UTC) by Perrin

Message
Well then honestly nick the real problem is my proficiency
with scripting. I was attempting to make a spellup plugin that grows with the user without a large database using skill and lvl checks since muds evolve and spellmsgs change.


If what I am trying to do isn't really feasible. All I can do is drop the matter since it works fine for me if I move the problematic code to world aliases. Was just trying to make something cool for my friends.

aardwolf player
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 27 Nov 2010 08:50 PM (UTC)  quote  ]
Message
Nick Gammon said:
Load the "summary" plugin. Type "summary". That shows, amongst other things, your plugins. Next to each plugin is a link like [Tr] which, if you click on it will list that plugin's triggers. Then you can look at individual triggers.

Ack. I keep forgetting about that thing. :S

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Sat 27 Nov 2010 08:48 PM (UTC)  quote  ]
Message
I'm completely confused about what you are trying to do here. First, the regexp:


^(add trigger(s|)|addtrigger(s|))$


For one optional letter, just put a question mark, eg.


^add ?triggers?$


That makes the space optional and the "s" optional.

And then inside the addtrigger alias you do this:


addtriggerex ""&getvariable ("asv1")&"3", ""&getvariable ("asv4")&"", 

"enabletrigger ""&getvariable("asv1")&"1", 1", 1, -1, 0, "", "", 12, 100
addtriggerex ""&getvariable ("asv1")&"2", ""&getvariable ("asv3")&"", 
  
addtriggerex ""&getvariable ("asv1")&"1", "^You flex your muscles proudly\!$", "send 

"c "&getvariable("asv2")&""", 1, -1, 0, "", "", 12, 100
addtriggerex ""&getvariable ("asv1")&"4", ""&getvariable ("asv5")&"", "send 

"c "&getvariable("asv2")&""", 1, -1, 0, "", "", 12, 100  
exportxml (0, ""&getvariable ("asv1")&"1")
exportxml (0, ""&getvariable ("asv1")&"2")
exportxml (0, ""&getvariable ("asv1")&"3")
exportxml (0, ""&getvariable ("asv1")&"4")

enabletrigger ""&getvariable("asv1")&"1", 1", 1, -1, 0, "", "", 12, 100
enabletrigger "cancel", 0


Whatever it is you are trying to achieve, this is not the way to do it. Honestly.

Perhaps if you explain what the real problem is - not "trying to add a heap of triggers".

Twisol said:

... there's no easy way to look at the list of triggers in a plugin like that ...


Load the "summary" plugin. Type "summary". That shows, amongst other things, your plugins. Next to each plugin is a link like [Tr] which, if you click on it will list that plugin's triggers. Then you can look at individual triggers.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Perrin   USA  (31 posts)  [Biography] bio
Date Sat 27 Nov 2010 11:15 AM (UTC)  quote  ]

Amended on Sat 27 Nov 2010 02:30 PM (UTC) by Perrin

Message
yes tested trigger with world aliases and still cannot find created trigger

"check triggers" returns:
name 'manna' spellnum '123' spellon 'you feel a surge of power.' spelloff 'you feel you extra power drain.' spellfail 'you fail at casting manna.'

which is correct but "add triggers" doesn't seem to do anything

aardwolf player
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 27 Nov 2010 10:31 AM (UTC)  quote  ]
Message
Your translation is incorrect, unless you repeat on the same character every time. """ actually translates to """, otherwise there would be no way to literally write """.

Did you check the triggers list after running the alias? When I used it, it added them. (Test it in the world aliases, not the plugin aliases, because there's no easy way to look at the list of triggers in a plugin like that.)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Perrin   USA  (31 posts)  [Biography] bio
Date Sat 27 Nov 2010 09:23 AM (UTC)  quote  ]

Amended on Sat 27 Nov 2010 01:43 PM (UTC) by Perrin

Message
&quot: is a special entity for "
and & is a special entity for &
thanks for that catch twisol

<send>addtriggerex ""&amp;getvariable ("asv1")&amp;"3", ""&amp;getvariable ("asv4")&amp;"", 

"enabletrigger &amp;quot;"&amp;getvariable("asv1")&amp;"1&amp;quot;, 1", 1, -1, 0, "", "", 12, 100
addtriggerex ""&amp;getvariable ("asv1")&amp;"2", ""&amp;getvariable ("asv3")&amp;"", 
  
addtriggerex ""&amp;getvariable ("asv1")&amp;"1", "^You flex your muscles proudly\!$", "send 

&amp;quot;c "&amp;getvariable("asv2")&amp;"&amp;quot;", 1, -1, 0, "", "", 12, 100
addtriggerex ""&amp;getvariable ("asv1")&amp;"4", ""&amp;getvariable ("asv5")&amp;"", "send 

&amp;quot;c "&amp;getvariable("asv2")&amp;"&amp;quot;", 1, -1, 0, "", "", 12, 100  


ok asuming the other triggers function correctly
and set values to the variables to

asv1="manna"
asv2="123"
asv3="you feel a surge of power."
asv4="you feel you extra power drain."
asv5="you fail at casting manna."

my code should output

<send>addtriggerex "manna3", "you feel a surge of power.", "enabletrigger "manna1", 1", 1, -1, 0, "", "", 12, 100

addtriggerex "manna1", "^You flex your muscles proudly\!$", "send "c 123"", 1, -1, 0, "", "", 12, 100

addtriggerex "manna4", "you fail at casting manna.", "send "c 123"", 1, -1, 0, "", "", 12, 100

aardwolf player
[Go to top] top

Posted by Perrin   USA  (31 posts)  [Biography] bio
Date Sat 27 Nov 2010 09:14 AM (UTC)  quote  ]
Message
no error just no change to script or state

aardwolf player
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 27 Nov 2010 09:10 AM (UTC)  quote  ]
Message
Did you try what I posted? What error occurred, if any?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Perrin   USA  (31 posts)  [Biography] bio
Date Sat 27 Nov 2010 09:07 AM (UTC)  quote  ]
Message
Been thinking about it and, reading random forum posts.
Starting to look like i will have to use a exportXML
to save the triggers as variables and importXML them back.
but can't figure out how to export then import a large list

  <alias
   name="asa3"
   match="^(add trigger(s|)|addtrigger(s|))$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>addtriggerex ""&amp;getvariable ("asv1")&amp;"3", ""&amp;getvariable ("asv4")&amp;"", 

"enabletrigger &amp;quot;"&amp;getvariable("asv1")&amp;"1&amp;quot;, 1", 1, -1, 0, "", "", 12, 100
addtriggerex ""&amp;getvariable ("asv1")&amp;"2", ""&amp;getvariable ("asv3")&amp;"", 
  
addtriggerex ""&amp;getvariable ("asv1")&amp;"1", "^You flex your muscles proudly\!$", "send 

&amp;quot;c "&amp;getvariable("asv2")&amp;"&amp;quot;", 1, -1, 0, "", "", 12, 100
addtriggerex ""&amp;getvariable ("asv1")&amp;"4", ""&amp;getvariable ("asv5")&amp;"", "send 

&amp;quot;c "&amp;getvariable("asv2")&amp;"&amp;quot;", 1, -1, 0, "", "", 12, 100  
exportxml (0, ""&amp;getvariable ("asv1")&amp;"1")
exportxml (0, ""&amp;getvariable ("asv1")&amp;"2")
exportxml (0, ""&amp;getvariable ("asv1")&amp;"3")
exportxml (0, ""&amp;getvariable ("asv1")&amp;"4")

enabletrigger &amp;quot;"&amp;getvariable("asv1")&amp;"1&amp;quot;, 1", 1, -1, 0, "", "", 12, 100
enabletrigger "cancel", 0
</send>
  </alias>

Is my best attempt.

aardwolf player
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 27 Nov 2010 08:40 AM (UTC)  quote  ]

Amended on Sat 27 Nov 2010 08:41 AM (UTC) by Twisol

Message
This is kind of nuts, you have weird XML bits in the code even after importing, like &amp;quot; becomes &quot;. Very odd, but I tried to fix it up.

<aliases>
  <alias
   name="asa3"
   match="^(add trigger(s|)|addtrigger(s|))$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>addtriggerex getvariable ("asv1") &amp; "3", getvariable ("asv4"), "enabletrigger getvariable(""asv1"") &amp; ""1"", 1", 1, -1, 0, "", "", 12, 100
addtriggerex getvariable ("asv1") &amp; "2", getvariable ("asv3"), "world.enabletrigger getvariable(""asv1"") &amp; ""1"", 1", 1, -1, 0, "", "", 12, 100  
addtriggerex getvariable ("asv1") &amp; "1", "^You flex your muscles proudly\!$", "send ""c " &amp; getvariable("asv2") &amp; """", 1, -1, 0, "", "", 12, 100
addtriggerex getvariable ("asv1") &amp; "4", getvariable ("asv5"), "send ""c " &amp; getvariable("asv2") &amp; """", 1, -1, 0, "", "", 12, 100  

enabletrigger "cancel", 0
</send>
  </alias>
</aliases>


[EDIT]: Are you dead set on using VBscript? Lua is way easier to use in my opinion. I only bring it up because this looks insane. :D

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Perrin   USA  (31 posts)  [Biography] bio
Date Sat 27 Nov 2010 08:26 AM (UTC)  quote  ]
Message
Thank you a ton now on to a slightly more complex problem.
I am trying to have a plugin expand itself and not quite sure them problem not receiving an error msg.
Here is the alias in question.

  <alias
   name="asa3"
   match="^(add trigger(s|)|addtrigger(s|))$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>addtriggerex ""&amp;getvariable ("asv1")&amp;"3", ""&amp;getvariable ("asv4")&amp;"", 

"enabletrigger &amp;quot;"&amp;getvariable("asv1")&amp;"1&amp;quot;, 1", 1, -1, 0, "", "", 12, 100
addtriggerex ""&amp;getvariable ("asv1")&amp;"2", ""&amp;getvariable ("asv3")&amp;"", 

"world.enabletrigger &amp;quot;"&amp;getvariable("asv1")&amp;"1&amp;quot;, 1", 1, -1, 0, "", "", 

12, 100  
addtriggerex ""&amp;getvariable ("asv1")&amp;"1", "^You flex your muscles proudly\!$", "send 

&amp;quot;c "&amp;getvariable("asv2")&amp;"&amp;quot;", 1, -1, 0, "", "", 12, 100
addtriggerex ""&amp;getvariable ("asv1")&amp;"4", ""&amp;getvariable ("asv5")&amp;"", "send 

&amp;quot;c "&amp;getvariable("asv2")&amp;"&amp;quot;", 1, -1, 0, "", "", 12, 100  
enabletrigger "cancel", 0
</send>
  </alias>


aardwolf player
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 27 Nov 2010 08:07 AM (UTC)  quote  ]
Message
Ah, yeah. If you look here \[1], you can see that there are two syntaxes for if-else-then. It explains that it decides which one you're using by looking at what comes after "then". In this case, it was expecting the single-line version, so the "end if" you added was invalid. I'd stick with the block syntax (what I posted) because it's easier to read and maintain though.

\[1] http://msdn.microsoft.com/en-us/library/5h27x7e9.aspx

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[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.


4,263 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]