[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]  Lua
. . -> [Subject]  I just learned what a function is 10minutes ago. Who wants to help! :)

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: I just learned what a function is 10minutes ago. Who wants to help! :)
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 Onoitsu2   USA  (246 posts)  [Biography] bio
Date Tue 10 Apr 2007 02:07 AM (UTC)  quote  ]
Message
I too tried to install zMud, not planning on switching, would not over my own dead body either, but wanted to attempt to make conversions from zmud a ton easier for myself. I failed miserably with v7.21 due to the same crash error, and just used an older version, 6.16 in fact. I am attempting to determine the DB formatting, whether it is using SOME standard system, or a system all its own, because IF it is a standard system, then that is a step in the right direction for a mapper, or at least using maps made using zMud :)

Laterzzz,
Onoitsu2
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 09 Apr 2007 09:28 PM (UTC)  quote  ]
Message
I'm glad you like it, and look forwards to seeing your scripts posted here. :)

- Nick Gammon

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

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Mon 09 Apr 2007 07:12 PM (UTC)  quote  ]
Message
Sure, I did post 'almost' the same question on the zmud forum, but there was 1 difference I didn't mention on zmud forum.

I'm shopping for a new mud client and I want to make sure whichever one I commit to is going to be the right choice for me(support/functionality).

I probably wouldn't have even found MUSHclient if the latest zmud 7.21 didn't cause a code4 error and crash immediately when i ran it. So I asked my friends in irc for what I should do and I got 3 suggestions: dl an earlier version of zmud/dl MUSHclient(i never heard of it)/dont bother switching your client.

Now it's been about a week since I've been using mushclient and I'm liking it a lot. I think the forum support here has been great these last few days too. I don't see myself switching to zmud...

On another note, I'm going to try and get a rescue script and heal script working with LUA with both of them being accessable from other worlds. I'll be posting those soon :)
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 09 Apr 2007 08:48 AM (UTC)  quote  ]
Message
You know what a really strange thing is?

On the zMUD forum, there is a posting from Reallycurious, entitled "I just learned what a function is 10minutes ago. Who wants to help! :)" - and it reads:

Quote:

I'm going to have multiple connections to a mud and I want to create an 'auto assist' type thing for some of the windows. In my old client I'd just trigger something like "$assistvariableguy massacres" = assist, etc and then make an alias #alias {autto %1} {#var assistvariableguy %1}.


Are you posting exactly the same question on all the client forums?

Here is the link:

http://forums.zuggsoft.com/phpbb/viewtopic.php?t=27001

- Nick Gammon

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

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Mon 09 Apr 2007 05:27 AM (UTC)  quote  ]
Message
niiiiiiice
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 09 Apr 2007 04:26 AM (UTC)  quote  ]

Amended on Wed 18 Apr 2007 10:30 PM (UTC) by Nick Gammon

Message
Quote:

I'm still very used to using simple triggers from my old client, "#action {you are hungry} {eat food}" for example.


You can easily make an alias to do just that:


<aliases>
  <alias
   match="#action {*} {*}"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

require "addxml"  -- addxml extension

-- add the trigger 

addxml.trigger {  
  match = "%1", 
  send = "%2",
  sequence = 100,
  enabled = true,
               }

ColourNote ("white", "green", "Added trigger to match on '%1', sending '%2'")
</send>
  </alias>
</aliases>






Now if I type:


#action {you are hungry} {eat food}


I see echoed:


Added trigger to match on 'you are hungry', sending 'eat food'


And, this trigger is now added to the trigger list:


<triggers>
  <trigger
   enabled="y"
   match="you are hungry"
   sequence="100"
  >
  <send>eat food</send>
  </trigger>
</triggers>


- Nick Gammon

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

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Mon 09 Apr 2007 02:04 AM (UTC)  quote  ]

Amended on Mon 09 Apr 2007 02:22 AM (UTC) by ReallyCurious

Message
thanks Shaun. works now.

Yea it was a mud command. I'm still very used to using simple triggers from my old client, "#action {you are hungry} {eat food}" for example.

Does this way seem too sloppy? Is there something else I should be doing here?

Here is the end result:

World1.

<aliases>
<alias
match="autto *"
enabled="y"
send_to="12"
sequence="100"
>
<send>world2 = assert (GetWorld ("world2"),
"world2 not open") -- get world

assert (world2:IsConnected(),
"world2 is not connected") -- check connected
world2:SetVariable("assister1", "%1")
world2:SetVariable("assister2", "%1")</send>
</alias>
</aliases>

World2:

<triggers>
<trigger
enabled="y"
match="*is dead! R.I.P."
send_to="12"
sequence="100"
>
<send>SetVariable ("assister1",GetVariable("assister2"))</send>

</trigger>
<trigger
enabled="y"
expand_variables="y"
match="@assister1 misses *"
send_to="12"
sequence="100"
>
<send>Send ("assist")
SetVariable ("assister1", "kdfjskfjsf")</send>
</trigger>
</triggers>

[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Mon 09 Apr 2007 01:54 AM (UTC)  quote  ]
Message
is assist a function, or an alias? If it's a function, then it needs to be assist(). If it's an alias, then it needs to be Execute( "assist" ). If it's a mud command, then Send( "assist" ).

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Mon 09 Apr 2007 01:07 AM (UTC)  quote  ]
Message
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="@assister1 misses *"
sequence="100"
>
<send>assist
SetVariable ("assister1", "kdfjskfjsf")</send>
</trigger>
</triggers>

I want it to execute assist one time and then change "assister1" variable so it doesn't keep assisting every combat round.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 08 Apr 2007 08:45 PM (UTC)  quote  ]
Message
In what way? Can you post the whole alias? The snippets I see above are a bit worrying:


<send>Assist
SetVariable ("assister", "adfsfdsfs")</send>


What is that word "Assist" on its own? That isn't a script command.

- Nick Gammon

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

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Sun 08 Apr 2007 12:09 PM (UTC)  quote  ]

Amended on Sun 08 Apr 2007 05:39 PM (UTC) by ReallyCurious

Message
Thanks.

The alias is working now. The "* is dead! R.I.P." works now.

"*@assister1 misses" works to assist but SetVariable ("assister1", "kdfjskfjsf") isn't.

How can I fix the setvariable?
[Go to top] top

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Sun 08 Apr 2007 10:46 AM (UTC)  quote  ]

Amended on Sun 08 Apr 2007 10:56 AM (UTC) by Onoitsu2

Message
Quote:
world2:Send ("SetVariable ("assister1", "%1")")


ok that ought to be...

world2:SetVariable("assister1", "%1")


The Send command is for sending something to the connected mud, not to the WORLD itself, the 'world2:' is responsible for sending it to the WORLD.

and

Quote:
<triggers>
<trigger
enabled="y"
match="assister misses"
send_to="10"
sequence="100"
>
<send>Assist
SetVariable ("assister", "adfsfdsfs")</send> -- change variable so I'm not spamming assist.
</trigger>
</triggers>


SHOULD be something like...

<triggers>
<trigger
enabled="y"
match="@assister misses"  <--Add @ infront of Variable Name
expand_variables="y"      <--ADD THIS LINE! Not this comment
send_to="10"
sequence="100"
>
<send>Assist
SetVariable ("assister", "adfsfdsfs")</send>
</trigger>
</triggers>


and

Quote:
<send>SetVariable ("assister","GetVariable("assister2")")


you are using too many double quotes, you do not need to quote COMMANDS such as GetVariable, but you DO need to quote text that is sent into that command, ie. the "assister2", this is what that line ought to be ...

<send>SetVariable ("assister",GetVariable("assister2"))


Hope that solves your problems for the time being.


[Go to top] top

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Sun 08 Apr 2007 09:53 AM (UTC)  quote  ]
Message
oh ya the connection issue was my router. forgot to mention that.
[Go to top] top

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Sun 08 Apr 2007 09:50 AM (UTC)  quote  ]
Message
I think I got what I was looking for with using a handful of variables/triggers/aliases and the getworld alias you pasted. But, I'm not doing a lot of things correctly.

question 1:

<aliases>
<alias
match="autto *"
enabled="y"
send_to="12"
sequence="100"
>
<send>world2 = assert (GetWorld ("world2"),
"world2 not open") -- get world

assert (world2:IsConnected(),
"world2 is not connected") -- check connected

world2:Send ("asist %1")
</send>
</alias>
</aliases>

I want to set a variable in world2.

world2:Send ("SetVariable ("assister1", "%1")") didn't work. I tried to use a trigger in world2 to create the variables that way:

<triggers>
<trigger
enabled="y"
match="asist *"
send_to="1"
sequence="100"
>
<send>SetVariable ("assister", "%1")
SetVariable ("assister2", "%1")</send>
</trigger>
</triggers>

question 2:

<triggers>
<trigger
enabled="y"
match="assister misses"
send_to="10"
sequence="100"
>
<send>Assist
SetVariable ("assister", "adfsfdsfs")</send> -- change variable so I'm not spamming assist.
</trigger>
</triggers>

How do I make this trigger recognize the value of variable "assister"?

<triggers>
<trigger
enabled="y"
match="is dead! R.I.P."
sequence="100"
>
<send>SetVariable ("assister","GetVariable("assister2")")</send> -- Trying to set variable back to what it just was after mob death so I assist again.
</trigger>
</triggers>

Still not sure on how to use getvariable properly.



[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sat 07 Apr 2007 09:00 PM (UTC)  quote  ]
Message
Quote:

I want to be able to set aliases/triggers/variables/highlights/subs etc through the command line.


Yes, you can use AddTrigger etc. to do that, it could be a little tedious - the GUI interface is readily available.

You can always make an alias that does a shortened version of AddTrigger, if you want to make a command-line version, and just accept the things you think you would want.


Quote:

Also, I noticed that if I have multiple connections to a mud if 1 of those connections gets disconnected due to a lag timeout, all of my connections get disconnected. Is this typical? Is there any way to resolve it?


This shouldn't happen unless your router itself is disconnecting you, in which case I would expect all connections to drop.

- Nick Gammon

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