[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]  General
. . -> [Subject]  Little help for a Total Newbie?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Little help for a Total Newbie?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
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 Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Thu 09 Sep 2004 03:30 PM (UTC)  quote  ]

Amended on Thu 09 Sep 2004 05:00 PM (UTC) by Poromenos

Message
Quote:

Flannel said:
I really am not quite sure why youd add things from the command line that werent temporary.

This is why:
Quote:

Flannel said:
It might be a good plugin to make, a whole plugin for ZMud users to feel more like Zmud. Well, without the bloat, and faster. Or at least some well-used features.


Quote:

Flannel said:
Just have the plugin note stuff (like the enabling scripting et al) and have a third alias which outputs the stuff they can copy/paste into their main world file to enable permanant addition of things.


That defeats the purpose of not having to go in the triggers dialog. Anyway, I just included this for all the people that told me "You can't add stuff from the command line? This sucks."

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Wed 08 Sep 2004 09:57 PM (UTC)  quote  ]

Amended on Wed 08 Sep 2004 09:59 PM (UTC) by Flannel

Message
Because that would be utterly annoying.

Cant you use world.execture to throw the addaliases into the world script space? (Youd have to have them enable scripting, and select a script engine, but still).

I really am not quite sure why youd add things from the command line that werent temporary. Or at least not on the fly. Just have the plugin note stuff (like the enabling scripting et al) and have a third alias which outputs the stuff they can copy/paste into their main world file to enable permanant addition of things.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Wed 08 Sep 2004 09:46 PM (UTC)  quote  ]
Message
Turns out that the triggers are added to the plugin space, which makes them pretty much temporary... Why not just include 3 triggers in the default world configuration?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Wed 08 Sep 2004 12:49 PM (UTC)  quote  ]

Amended on Sun 12 Sep 2004 06:56 PM (UTC) by Poromenos

Message
Could you add this to the plugins page, Nick?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Tue 07 Sep 2004 03:08 PM (UTC)  quote  ]
Message

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, September 07, 2004, 6:06 PM -->
<!-- MuClient version 3.49 -->

<!-- Plugin "Zmud" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Zmud"
   author="Poromenos"
   id="a6cd5dd530cc392b3c69f88f"
   language="VBscript"
   purpose="Allows elements to be added from the command line, Zmud-style."
   date_written="2004-09-07 18:05:51"
   requires="3.49"
   version="1.0"
   >

</plugin>


<!--  Aliases  -->

<aliases>
  <alias
   script="sbAddTimer"
   match="^\#TI (\d+) (\d+) (\d+) \{(.*?)\}$"
   enabled="y"
   regexp="y"
   ignore_case="y"
   sequence="100"
  >
  </alias>
  <alias
   script="sbAddTrigger"
   match="^\#TRIGGER \{(.*?)\}[ ]+\{(.*?)\}$"
   enabled="y"
   regexp="y"
   ignore_case="y"
   sequence="100"
  >
  </alias>
  <alias
   script="sbAddAlias"
   match="^\#ALIAS (.*?) \{(.*?)\}$"
   enabled="y"
   regexp="y"
   ignore_case="y"
   sequence="100"
  >
  </alias>
</aliases>

<!--  Script  -->


<script>
<![CDATA[
Sub sbAddTrigger(strName, strLine, strWildcards)
    AddTrigger "", strWildcards(1), strWildcards(2), 9, -1, 0, "", ""
    ColourNote "red", "", "Trigger on """ & strWildcards(1) & """ added."
End Sub

Sub sbAddAlias(strName, strLine, strWildcards)
    AddAlias "", strWildcards(1), strWildcards(2), 545, ""
    ColourNote "red", "", "Alias on """ & strWildcards(1) & """ added."
End Sub

Sub sbAddTimer(strName, strLine, strWildcards)
    AddTimer "", Int(strWildcards(1)), Int(strWildcards(2)), Int(strWildcards(3)), strWildcards(4), 1, ""
    ColourNote "red", "", "Timer at """ & Int(strWildcards(1)) & ":" & Int(strWildcards(2)) &  ":" &Int(strWildcards(3)) & """ added."
End Sub


]]>
</script>


</muclient>


Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Tue 07 Sep 2004 02:47 PM (UTC)  quote  ]
Message
I am making the plugin, it will be ready in a few. And, Nick, I don't understand it either, but the fact is that you're losing customers to it :p

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 06 Sep 2004 10:37 PM (UTC)  quote  ]
Message
Go for it. :)

However I can't quite understand why using a dialog box is harder than doing something like:

#TRIGGER {You are currently in:} {#T+ Location;#WA 2000;#T- Location}

- Nick Gammon

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

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Mon 06 Sep 2004 06:56 AM (UTC)  quote  ]
Message
Took me about half an hour to explain to someone that we could indeed write an alias to add an alias/trigger, since he wanted to edit on the fly.

It might be a good plugin to make, a whole plugin for ZMud users to feel more like Zmud. Well, without the bloat, and faster. Or at least some well-used features.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Shadowfyr   USA  (1,774 posts)  [Biography] bio
Date Mon 06 Sep 2004 06:44 AM (UTC)  quote  ]
Message
I seriously considered a plugin that would take anything starting with # and parse it into mushclient functions as though it was zmud. Until the addition of 'send to script' though some things where not terribly practical and a few would still be problematic. Since then I came to my senses. ;) lol

main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Sun 05 Sep 2004 10:25 PM (UTC)  quote  ]
Message
I think Nick should just include 2-3 aliases that make triggers/aliases from the command line, so we can tell newbies "Type #trigger {match on;send}" or whatever. Most people find MUSHclient more difficult because they have to go into a dialog box to add triggers, I think.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 05 Sep 2004 05:36 AM (UTC)  quote  ]
Message
Quote:

if world.getvariable(MagicArmor) = 0 then
world.send "cast " & chr(34) & "Magic Armor" & chr(34) & Ordan
world.setvariable "MagicArmor",1
end if


You used quotes the second time but not the first. Also you can use quotes inside quotes by doubling them.

You could have done the whole thing in "send to script". That is:

Match: spell up *
Send:


if getvariable ("MagicArmor") = "0" then
  send "cast ""Magic Armor"" Ordan"
  setvariable "MagicArmor", "1" 
end if


Send to: script


- Nick Gammon

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

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Sat 04 Sep 2004 06:43 AM (UTC)  quote  ]
Message
You probably need to make "Ordan" into a string (when you cast) too (and remember your spaces).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Abas   (6 posts)  [Biography] bio
Date Sat 04 Sep 2004 02:22 AM (UTC)  quote  ]
Message
Ah, ok. I need to put quotes around the variable to get its global value. And no quote will only get me the local value.

I will try that.


Thanks
[Go to top] top

Posted by Shadowfyr   USA  (1,774 posts)  [Biography] bio
Date Fri 03 Sep 2004 06:35 PM (UTC)  quote  ]
Message
These lines are wrong:

world.send "The value of MagicArmor is " & " " & world.GetVariable(MagicArmor)

if world.getvariable(MagicArmor) = 0 then

You must place "MagicArmor" in quotes. What Mushclient thinks you are doing above is telling it, "Take the value in the 'VBScript' variable MagicArmor and use that to find a Mushclient variable and return its value."

This lets you do things like:

sub setstatus(a, b, c)
Playername = c(1)
setvariable "PS_" & Playername, 1
end sub

In other words, you might match on "Fred joins your party." and the script would set a variable called 'PS_Fred' to 1, to show he is in the party. You could then later run a search on all variables that contain 'PS_' to find a list of player names and which ones are in a party. Basically, you have to remember that getvariable and setvariable have to be given a name in "". If you leave that off, then the script automatically assumes you are now talking about the contents of a script variable, not the name of a Mushclient variable.

main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
[Go to top] top

Posted by Abas   (6 posts)  [Biography] bio
Date Fri 03 Sep 2004 03:30 AM (UTC)  quote  ]

Amended on Fri 03 Sep 2004 05:31 AM (UTC) by Abas

Message
Need more help.


2=========================================================

The Trigger
------------
Trigger: test1
Send:
Send To: Script
Label: test
Script: test




The Script
----------



Sub test(a,b,c)

world.send "The value of MagicArmor is " & " " & world.GetVariable(MagicArmor)

if world.getvariable(MagicArmor) = 0 then
world.send "cast " & chr(34) & "Magic Armor" & chr(34) & Ordan
world.setvariable "MagicArmor",1
end if
world.send "Hello All"
end sub

[Note: MagicArmor is suppose to be my global variable. If it is 0 then the spell is not on me, if it is 1 then it is on. I "Add"ed MagicArmor in the Scripting->Variables section and gave it a value of 0. However, the spell is not casting. :( ]

[Problem, I also get "THere are no value within" from outputing wolrd.GetVariable(MagicArmor). If I comment out If/end if, then world.setvariable "MagicArmor",1 actually set MagicArmor to 1.]
[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.


5,713 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]