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, 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.
 Entire forum ➜ Programming ➜ General ➜ zmud -> Mushclient script

zmud -> Mushclient script

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


Posted by Ashass   (50 posts)  Bio
Date Sat 22 Nov 2008 03:48 PM (UTC)
Message
I've been having trouble converting a zmud script into mushclient, it's a pretty complicated script and would appreciate any/all help I may receive!


#DELCLASS Brewscript
#CLASS 0
#ALIAS Brewing {#IF %trigger(BrewScript) {#T- BrewScript;#SAY Brewscript OFF} {#T+ BrewScript;#SAY Brewscript ON}}

#CLASS {BrewScript}
#ALIAS gourds {#VAR gourd_sorting 1;#VAR gourd_list "|";#VAR gourd_affects "|";#VAR gourd_inv "";inven}
#ALIAS apply {#IF %begins( "%-1", "'") {#VAR use_gourd %word( "%-1", 2, "'")} {#VAR use_gourd {%1}};~apply %-1}
#ALIAS toss {#IF %begins( "%-1", "'") {#VAR use_gourd %word( "%-1", 2, "'")} {#VAR use_gourd {%1}};~toss %-1}
#ALIAS quaff {#IF %begins( "%-1", "'") {#VAR use_gourd %word( "%-1", 2, "'")} {#VAR use_gourd {%1}};~quaff %-1}
#ALIAS check_gourds {lore '%item( @gourd_inv, @gourd_num)';#IF %eval( %numitems( @gourd_inv) < @gourd_num) {#VAR gourd_sorting 0;#VAR gourd_inv "";inven}}
#ALIAS remove_gourd {#IF %isnumber( %left( @use_gourd, 1)) {#VAR gourd_num %left( @use_gourd, 1);#VAR use_gourd %right( @use_gourd, 2)} {#VAR gourd_num 1};#IF %len( %2) {#VAR gourd_count %numitems( @gourd_list);#WHILE @gourd_count {#IF %begins( %item( @gourd_list, @gourd_count), %1) {#DELNITEM gourd_list @gourd_count;#DELNITEM gourd_affects @gourd_count;#VAR gourd_count 0} {#ADD gourd_count -1;#IF %eval( @gourd_count = 0) {#SAY ERROR - could not find a match for the used gourd - last}}}} {#IF %eval( (@gourd_num = 1) & %len( %1)) {#VAR gourd_count %ismember( %1, @gourd_list);#DELNITEM gourd_list @gourd_count;#DELNITEM gourd_affects @gourd_count} {#IF %len( %1) {#VAR use_gourd {%1}};#VAR gourd_count 1;#WHILE @gourd_count {#IF %begins( %item( @gourd_list, @gourd_count), @use_gourd) {#IF %eval( @gourd_num > 1) {#ADD gourd_num -1;#ADD gourd_count 1} {#DELNITEM gourd_list @gourd_count;#DELNITEM gourd_affects @gourd_count;#VAR gourd_count 0}} {#ADD gourd_count 1;#IF %eval( @gourd_count > %numitems( @gourd_list)) {#VAR gourd_count 0;#SAY ERROR - could not find a match for the used gourd}}}}}}
#VAR gourd_affects {}
#VAR gourd_list {}
#VAR gourd_inv {}
#VAR use_gourd {}
#VAR gourd_num {0}
#VAR gourd_loops {0}
#VAR gourd_count {0}
#VAR gourd_sorting {0}
#TRIGGER {^You create a bubbling potion!$} {#T+ BrewScript|id_gourd;lore gourd}
#TRIGGER {^You are carrying:$} {#IF @gourd_sorting {#T+ BrewScript|sort_inv} {#T+ BrewScript|list_inv}}
#TRIGGER {^You apply a potion gourd of ([A-z ]) to} {remove_gourd {%param1}}
#TRIGGER {^You quaff a potion gourd of ([A-z ]).$} {remove_gourd {%param1}}
#TRIGGER {^You throw a gourd right at} {remove_gourd}
#TRIGGER {^A potion gourd of ([A-z ]) has evaporated from disuse.$} {remove_gourd {%param1} 1}
#TRIGGER {^You fumble around inexpertly with a potion gourd of ([A-z ]) accidentally spilling it.$} {remove_gourd {%param1}}
#CLASS 0

#CLASS {BrewScript|id_gourd} {disable}
#TRIGGER {^Level %d spells of: '(*)'.$} {#VAR gourd_list %concat( "|", %word( %param1, 1, "' '"), @gourd_list);#VAR gourd_affects %concat( "|", %replace( %remove( "' 'reserved", %param1), "' '", " / "), @gourd_affects);#IF @gourd_sorting {#ADD gourd_num 1;check_gourds} {#T- BrewScript|id_gourd}}
#TRIGGER {^Can't make heads or tails of it.$} {#IF @gourd_sorting {check_gourds} {lore gourd}}
#CLASS 0

#CLASS {BrewScript|list_inv} {disable}
#ALIAS list_gourd {#ADD gourd_count %max( 1, %numitems( %word( @gourd_list, @gourd_num, %concat( "|", @gourd_inv))));#SAY {%e[0m"     "gourd %ansi( brown)<@gourd_num>.@gourd_inv %e[0m(%ansi( cyan)%item( @gourd_affects, @gourd_count)%e[0m)};#ADD gourd_num 1;#IF %eval( @gourd_loops >= @gourd_num) {list_gourd}}
#TRIGGER {^     a potion gourd of ([A-z ])$} {#SUB {"     gourd" %ansi(brown)%param1 %e[0m(%ansi(cyan)%item(@gourd_affects,%ismember( %param1, @gourd_list))%e[0m)}}
#TRIGGER {$} {#T- BrewScript|list_inv}
#TRIGGER {^~(([ 0-9])~) a potion gourd of ([A-z ])$} {#GAG;#VAR gourd_count 1;#VAR gourd_num 1;#VAR gourd_loops %trim( %param1);#VAR gourd_inv %param2;list_gourd}
#CLASS 0

#CLASS {BrewScript|sort_inv} {disable}
#ALIAS add_gourds {#VAR gourd_inv {%concat( @gourd_count.@use_gourd, %if( %len( @gourd_inv), "|"), @gourd_inv)};#ADD gourd_count 1;#IF %eval( @gourd_count <= @gourd_num) {add_gourds}}
#TRIGGER {^     a potion gourd of ([A-z ])$} {#VAR gourd_inv {%concat( %param1, %if( %len( @gourd_inv), "|"), @gourd_inv)}}
#TRIGGER {^~(([ 0-9])~) a potion gourd of ([A-z ])$} {#VAR gourd_count 1;#VAR gourd_num %trim( %param1);#VAR use_gourd {%param2};add_gourds}
#TRIGGER {$} {#T- BrewScript|sort_inv;#T+ BrewScript|id_gourd;#VAR gourd_num 1;check_gourds}
#CLASS 0
#SAY Brewscript installed version 1.1
Top

Posted by Terry   USA  (87 posts)  Bio
Date Reply #1 on Mon 23 Nov 2009 03:43 AM (UTC)
Message
I remembered this coming up before, so I did a quick search in the forums. Here's what I found. If it doesn't help, I'll take another look and see if I can write something up for you. :)
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3032
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #2 on Mon 23 Nov 2009 06:16 AM (UTC)

Amended on Mon 23 Nov 2009 06:17 AM (UTC) by Twisol

Message
My god... I can't imagine there could have been any better timing here.

EDIT: Well, I misread the original AM as a PM, but really, this is just too funny.

'Soludra' on Achaea

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

Posted by Terry   USA  (87 posts)  Bio
Date Reply #3 on Tue 24 Nov 2009 03:42 AM (UTC)
Message
Oh wow... Lmao, I didn't even notice the year... I thought he just posted earlier yesterday. XD
Top

Posted by Nick Gammon   Australia  (23,070 posts)  Bio   Forum Administrator
Date Reply #4 on Tue 24 Nov 2009 04:45 AM (UTC)
Message
Someone is going around answering old threads. ;)

A year and a day isn't too bad, eh?

- Nick Gammon

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

Posted by Terry   USA  (87 posts)  Bio
Date Reply #5 on Tue 24 Nov 2009 06:21 PM (UTC)
Message
I try to do my civic duty. :) *chants* What do we want? An answer! When do we want it? *archives chant to be finished at a later time*
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #6 on Tue 24 Nov 2009 09:17 PM (UTC)

Amended on Fri 21 Jan 2011 07:16 AM (UTC) by Nick Cash

Message
Heh, when I first started posting I went and found each SWR post and responded to it if it hadn't been solved already... even if I was two or three years late!

Who knows, maybe someone will find them (or this post) and it will help them solve their questions! In the mean time, post_count++ :)

~Nick Cash
http://www.nick-cash.com
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.


26,404 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.