Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Dragan
Newbie


Joined: 26 Oct 2004
Posts: 6

PostPosted: Mon Dec 18, 2006 11:32 am   

HELP: Zmud scripting import to Cmud [1.24]
 
Can i get some help here pls, been checking this night, over night, over night and I still can't get it to work. I can get the script running with no error, but the script simply don't launch correctly on cmud. Please take in note that this script was for Zmud, and was simply import into CMUD and the *i was thinking so* the good arrangement to get it work. Sad

Code:
#CLASS {Crafting}
#ALIAS craftreport {clansay I am @proficiency~% proficient at @currentcraft, and I have gathered: %expanddb( @{@{CurrentCraft}_got}, "; ", " - ").}
#VAR CurrentCraft {Fisherman}
#VAR Proficiency {52}
#TRIGGER {You have improved your skills in %1!} {clansay I've gained a percent in %1!;#ADD proficiency 1}
#CLASS 0
#CLASS {Crafting|Herbs}
#ALIAS herbcheck {#FORALL @herbs {search %i}}
#VAR Herbs {Mushroom|Moss|Threadwort|Sliverweed|Sageleaf}
#VAR herbnums {mushroom24moss14threadwort12sliverweed8sageleaf3total61}
#VAR Herbalist_got {mushroom0moss0threadwort0sliverweed0sageleaf0}
#TRIGGER {You realize there is something here worth finding!$} {#CW green;#IF (@CurrentCraft="Herbalist") {clansay I've found some herbs!}}
#TRIGGER {You manage to find some (*).$} {#ADDKEY herbalist_got {%1} {%eval( %db( @herbalist_got, "%1")+1)}}
#TRIGGER {(%s)Mushroom - (%d) :(%s)Moss - (%d) :(%s)Threadwort - (%d) :(%s)Sliverweed - (%d) :(%s)Sageleaf - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@herbnums.mushroom,%ansi(green),%ansi(red))Mushroom - %2%ansi(gray) :%3%if(%eval(%4)=@herbnums.moss,%ansi(green),%ansi(red))Moss - %4%ansi(gray) :%5%if(%eval(%6)=@herbnums.threadwort,%ansi(green),%ansi(red))Threadwort - %6%ansi(gray) :%7%if(%eval(%8)=@herbnums.sliverweed,%ansi(green),%ansi(red))Sliverweed - %8%ansi(gray) :%9%if(%eval(%10)=@herbnums.sageleaf,%ansi(green),%ansi(red))Sageleaf - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@herbnums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE herbnums.mushroom {%eval( %2)};#VARIABLE herbnums.moss {%eval( %4)};#VARIABLE herbnums.threadwort {%eval( %6)};#VARIABLE herbnums.sliverweed {%eval( %8)};#VARIABLE herbnums.sageleaf {%eval( %10)};#VARIABLE herbnums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Herbalist") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Wood}
#ALIAS woodcheck {#FORALL @woods {cut %i}}
#VAR Woods {Pine|Cedar|Spruce|Oak|Ironwood}
#VAR woodnums {pine19cedar15spruce10oak10ironwood5total59}
#VAR woodcutter_got {pine0cedar0redwood0oak0ironwood0}
#TRIGGER {You have spotted a potential clump of trees to cut!!$} {#CW green;#IF (@CurrentCraft="Woodcutter") {clansay I've found some wood!}}
#TRIGGER {You manage to cut some (*).$} {#ADDKEY woodcutter_got {%1} {%eval( %db( @woodcutter_got, "%1")+1)}}
#TRIGGER {(%s)Pine - (%d) :(%s)Cedar - (%d) :(%s)Spruce - (%d) :(%s)Oak - (%d) :(%s)Ironwood - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@woodnums.pine,%ansi(green),%ansi(red))Pine - %2%ansi(gray) :%3%if(%eval(%4)=@woodnums.cedar,%ansi(green),%ansi(red))Cedar - %4%ansi(gray) :%5%if(%eval(%6)=@woodnums.spruce,%ansi(green),%ansi(red))Spruce - %6%ansi(gray) :%7%if(%eval(%8)=@woodnums.oak,%ansi(green),%ansi(red))Oak - %8%ansi(gray) :%9%if(%eval(%10)=@woodnums.ironwood,%ansi(green),%ansi(red))Ironwood - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@woodnums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE woodnums.pine {%eval( %2)};#VARIABLE woodnums.cedar {%eval( %4)};#VARIABLE woodnums.spruce {%eval( %6)};#VARIABLE woodnums.oak {%eval( %8)};#VARIABLE woodnums.ironwood {%eval( %10)};#VARIABLE woodnums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Woodcutter") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Metal}
#ALIAS metalcheck {#FORALL @metals {mine %i}}
#VAR metalnums {tin23copper16iron8adamant8mithral8total63}
#VAR Metals {Tin|Copper|Iron|Adamant|Mithral}
#VAR Miner_got {tin0copper0iron0adamant0mithral0}
#TRIGGER {You have spotted a vein of precious metals!!$} {#CW green;#IF (@CurrentCraft="Miner") {clansay I've found some metal!}}
#TRIGGER {You manage to mine some (*).$} {#ADDKEY miner_got {%1} {%eval( %db( @miner_got, "%1")+1)}}
#TRIGGER {(%s)Tin - (%d) :(%s)Copper - (%d) :(%s)Iron - (%d) :(%s)Adamant - (%d) :(%s)Mithral - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@metalnums.tin,%ansi(green),%ansi(red))Tin - %2%ansi(gray) :%3%if(%eval(%4)=@metalnums.copper,%ansi(green),%ansi(red))Copper - %4%ansi(gray) :%5%if(%eval(%6)=@metalnums.iron,%ansi(green),%ansi(red))Iron - %6%ansi(gray) :%7%if(%eval(%8)=@metalnums.adamant,%ansi(green),%ansi(red))Adamant - %8%ansi(gray) :%9%if(%eval(%10)=@metalnums.mithral,%ansi(green),%ansi(red))Mithral - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@metalnums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE metalnums.tin {%eval( %2)};#VARIABLE metalnums.copper {%eval( %4)};#VARIABLE metalnums.iron {%eval( %6)};#VARIABLE metalnums.adamant {%eval( %8)};#VARIABLE metalnums.mithral {%eval( %10)};#VARIABLE metalnums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Miner") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Minerals}
#ALIAS mineralcheck {#FORALL @minerals {prospect %i}}
#VAR mineralnums {salt11coal28sulfur9lodestone6flarepowder5total66flarestone12}
#VAR Minerals {Coal|Salt|Sulfur|Lodestone|Flarepowder}
#VAR Collier_got {coal0salt0sulfur0lodestone0flarestoner0}
#TRIGGER {You realize there is something here worth finding!$} {#CW green;#IF (@CurrentCraft="Collier") {clansay I've found some minerals!}}
#TRIGGER {You manage to prospect some (*).$} {#ADDKEY collier_got {%1} {%eval( %db( @collier_got, "%1")+1)}}
#TRIGGER {(%s)Coal - (%d) :(%s)Salt - (%d) :(%s)Sulfur - (%d) :(%s)Lodestone - (%d) :(%s)Flarestone - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@mineralnums.coal,%ansi(green),%ansi(red))Coal - %2%ansi(gray) :%3%if(%eval(%4)=@mineralnums.salt,%ansi(green),%ansi(red))Salt - %4%ansi(gray) :%5%if(%eval(%6)=@mineralnums.sulfur,%ansi(green),%ansi(red))Sulfur - %6%ansi(gray) :%7%if(%eval(%8)=@mineralnums.lodestone,%ansi(green),%ansi(red))Lodestone - %8%ansi(gray) :%9%if(%eval(%10)=@mineralnums.flarestone,%ansi(green),%ansi(red))Flarestone - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@mineralnums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE mineralnums.coal {%eval( %2)};#VARIABLE mineralnums.salt {%eval( %4)};#VARIABLE mineralnums.sulfur {%eval( %6)};#VARIABLE mineralnums.lodestone {%eval( %8)};#VARIABLE mineralnums.flarestone {%eval( %10)};#VARIABLE mineralnums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Collier") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Gems}
#ALIAS gemcheck {#FORALL @Gems {dig %i}}
#VAR Gems {Amethyst|Emerald|Ruby|Sapphire|Diamond}
#VAR gemnums {amethyst13emerald12ruby9sapphire4diamond3total41}
#VAR Gemologist_got {amethyst0emerald0ruby0sapphire0diamond0}
#TRIGGER {You spot something shiny!  Dig more!$} {#CW green;#IF (@CurrentCraft="Gemologist") {clansay I've found some gems!}}
#TRIGGER {You manage to dig some (*).$} {#ADDKEY gemologist_got {%1} {%eval( %db( @gemologist_got, "%1")+1)}}
#TRIGGER {(%s)Amethyst - (%d) :(%s)Emerald - (%d) :(%s)Ruby - (%d) :(%s)Sapphire - (%d) :(%s)Diamond - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@gemnums.amethyst,%ansi(green),%ansi(red))Amethyst - %2%ansi(gray) :%3%if(%eval(%4)=@gemnums.emerald,%ansi(green),%ansi(red))Emerald - %4%ansi(gray) :%5%if(%eval(%6)=@gemnums.ruby,%ansi(green),%ansi(red))Ruby - %6%ansi(gray) :%7%if(%eval(%8)=@gemnums.sapphire,%ansi(green),%ansi(red))Sapphire - %8%ansi(gray) :%9%if(%eval(%10)=@gemnums.diamond,%ansi(green),%ansi(red))Diamond - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@gemnums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE gemnums.amethyst {%eval( %2)};#VARIABLE gemnums.emerald {%eval( %4)};#VARIABLE gemnums.ruby {%eval( %6)};#VARIABLE gemnums.sapphire {%eval( %8)};#VARIABLE gemnums.diamond {%eval( %10)};#VARIABLE gemnums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Gemologist") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Stone}
#ALIAS stonecheck {#FORALL @stone {chisel %i}}
#VAR Stone {Sandstone|Basalt|Marble|Quartz|Obsidian}
#VAR stonenums {sandstone18basalt13marble8quartz7obsidian3total49}
#VAR StoneCutter_got {sandstone0basalt0marble0quartz0obsidian0}
#TRIGGER {You realize there is something here worth chiseling!$} {#CW green;#IF (@CurrentCraft="Stonecutter") {clansay I've found some stone!}}
#TRIGGER {You manage to chisel some (*).$} {#ADDKEY stonecutter_got {%1} {%eval( %db( @stonecutter_got, "%1")+1)}}
#TRIGGER {(%s)Sandstone - (%d) :(%s)Basalt - (%d) :(%s)Marble - (%d) :(%s)Quartz - (%d) :(%s)Obsidian - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@stonenums.sandstone,%ansi(green),%ansi(red))Sandstone - %2%ansi(gray) :%3%if(%eval(%4)=@stonenums.basalt,%ansi(green),%ansi(red))Basalt - %4%ansi(gray) :%5%if(%eval(%6)=@stonenums.marble,%ansi(green),%ansi(red))Marble - %6%ansi(gray) :%7%if(%eval(%8)=@stonenums.quartz,%ansi(green),%ansi(red))Quartz - %8%ansi(gray) :%9%if(%eval(%10)=@stonenums.obsidian,%ansi(green),%ansi(red))Obsidian - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@stonenums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE stonenums.sandstone {%eval( %2)};#VARIABLE stonenums.basalt {%eval( %4)};#VARIABLE stonenums.marble {%eval( %6)};#VARIABLE stonenums.quartz {%eval( %8)};#VARIABLE stonenums.obsidian {%eval( %10)};#VARIABLE stonenums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Stonecutter") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Marine Goods}
#ALIAS fishcheck {#FORALL @fish {fish %i}}
#VAR fishnums {fish9mollusk8saberfish6squid7oyster3total33}
#VAR fish {Fish|Mollusk|Saberfish|Squid|Oyster}
#VAR fish_got {Fish0Mollusk0Saberfish0Squid0Oyster0}
#TRIGGER {Your sixth sense tells you you should keep fishing here.} {#CW green;#IF (@CurrentCraft="Fisherman") {clansay I've found some marine goods!}}
#TRIGGER {You manage to fish some %1.$} {#ADDKEY fish_got {%1} {%eval( %db( @fish_got, "%1")+1)}}
#TRIGGER {(%s)Fish - (%d) :(%s)Mollusk - (%d) :(%s)Saberfish - (%d) :(%s)Squid - (%d) :(%s)Oyster - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@fishnums.fish,%ansi(green),%ansi(red))Fish - %2%ansi(gray) :%3%if(%eval(%4)=@fishnums.mollusk,%ansi(green),%ansi(red))Mollusk - %4%ansi(gray) :%5%if(%eval(%6)=@fishnums.saberfish,%ansi(green),%ansi(red))Saberfish - %6%ansi(gray) :%7%if(%eval(%8)=@fishnums.squid,%ansi(green),%ansi(red))Squid - %8%ansi(gray) :%9%if(%eval(%10)=@fishnums.oyster,%ansi(green),%ansi(red))Oyster - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@fishnums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE fishnums.fish {%eval( %2)};#VARIABLE fishnums.mollusk {%eval( %4)};#VARIABLE fishnums.saberfish {%eval( %6)};#VARIABLE fishnums.squid {%eval( %8)};#VARIABLE fishnums.oyster {%eval( %10)};#VARIABLE fishnums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Fisherman") {#HIGHLIGHT}} "" {case}
#CLASS 0
#CLASS {Crafting|Wild Game}
#ALIAS gamecheck {#FORALL @game {trap %i}}
#VAR Game {}
#VAR gamenums {edible17furry10feathered13venomous11horned5total56}
#VAR Trapper_got {edible0furry0feathered0venomous0horned0}
#TRIGGER {You realize there is something near by to trap!$} {#CW green;#IF (@CurrentCraft="Trapper") {clansay I've found some game!}}
#TRIGGER {You manage to extract some quality (*) from your prey.$} {#ADDKEY Trapper_got {%1} {%eval( %db( @trapper_got, "%1")+1)}}
#TRIGGER {(%s)Edible - (%d) :(%s)Furry - (%d) :(%s)Feathered - (%d) :(%s)Venomous - (%d) :(%s)Horned - (%d)$} {#SUBSTITUTE {"%1"%if(%eval(%2)=@gamenums.edible,%ansi(green),%ansi(red))Edible - %2%ansi(gray) :%3%if(%eval(%4)=@gamenums.furry,%ansi(green),%ansi(red))Furry - %4%ansi(gray) :%5%if(%eval(%6)=@gamenums.feathered,%ansi(green),%ansi(red))Feathered - %6%ansi(gray) :%7%if(%eval(%8)=@gamenums.venomous,%ansi(green),%ansi(red))Venomous - %8%ansi(gray) :%9%if(%eval(%10)=@gamenums.horned,%ansi(green),%ansi(red))Horned - %10%ansi(gray) : %if(%eval(%2+%4+%6+%8+%10)=@gamenums.total,%ansi(green),%ansi(red))Total: %eval(%2+%4+%6+%8+%10)};#VARIABLE gamenums.edible {%eval( %2)};#VARIABLE gamenums.furry {%eval( %4)};#VARIABLE gamenums.feathered {%eval( %6)};#VARIABLE gamenums.venomous {%eval( %8)};#VARIABLE gamenums.horned {%eval( %10)};#VARIABLE gamenums.total {%eval( %2+%4+%6+%8+%10)};#IF (@CurrentCraft="Trapper") {#HIGHLIGHT}} "" {case}
#CLASS 0


So, if someone can gimme some hint or help me a little, i'll be so damn happy, heh. Otherwise, no worries.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1241

PostPosted: Tue Dec 19, 2006 1:28 am   
 
I think you might have tell us a bit more, e.g. (i) what it is supposed to do, (ii) what it is doing. And that is a rather long script to debug - is the whole thing interrelated or it just one trigger that doesn't work?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Dec 19, 2006 5:47 am   
 
I haven't done too much with it yet but these to things jump out at me.

Expression evaluation require '==' and not '=' as you have in most of your %if commands.

Also there's no variable processing, substitution etc that takes place within quotes so your "%1" commands will literally produce that. Strip the quotes in those cases.
_________________
Asati di tempari!
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1241

PostPosted: Tue Dec 19, 2006 10:14 am   
 
Yes, did you run the compatibility report in CMUD?
Reply with quote
Dragan
Newbie


Joined: 26 Oct 2004
Posts: 6

PostPosted: Tue Dec 19, 2006 11:23 am   
 
Ok, this script if for crafting on my mud. When i type system, i can see the following ressource.


Without the Script on Zmud:

Sectors with Resources by Type:
----------------------------------------------------------------------------------------------------
Pine - 023 : Cedar - 012 : Spruce - 010 : Oak - 006 : Ironwood - 006
Tin - 018 : Copper - 010 : Iron - 010 : Adamant - 011 : Mithral - 009
Fish - 015 : Mollusk - 003 : Saberfish - 006 : Squid - 004 : Oyster - 000
Amethyst - 020 : Emerald - 018 : Ruby - 011 : Sapphire - 008 : Diamond - 003
Sandstone - 026 : Basalt - 013 : Marble - 012 : Quartz - 012 : Obsidian - 005
Mushroom - 021 : Moss - 008 : Threadwort - 013 : Sliverweed - 007 : Sageleaf - 006
Coal - 022 : Salt - 010 : Sulfur - 016 : Lodestone - 006 : Flarestone - 005
Edible - 017 : Furry - 015 : Feathered - 006 : Venomous - 010 : Horned - 010



With the script on Zmud

Pine - 023 : Cedar - 012 : Spruce - 010 : Oak - 006 : Ironwood - 006 : Total: 57
Tin - 018 : Copper - 010 : Iron - 010 : Adamant - 011 : Mithral - 009 : Total: 58
Fish - 015 : Mollusk - 003 : Saberfish - 006 : Squid - 004 : Oyster - 000 : Total: 28
Amethyst - 020 : Emerald - 018 : Ruby - 011 : Sapphire - 008 : Diamond - 003 : Total: 60
Sandstone - 026 : Basalt - 013 : Marble - 012 : Quartz - 012 : Obsidian - 005 : Total: 68
Mushroom - 021 : Moss - 008 : Threadwort - 013 : Sliverweed - 007 : Sageleaf - 006 : Total: 55
Coal - 022 : Salt - 010 : Sulfur - 016 : Lodestone - 006 : Flarestone - 005 : Total: 59
Edible - 017 : Furry - 015 : Feathered - 006 : Venomous - 010 : Horned - 010 : Total: 58


With the script on, the value i saw on system are store into the variable. It tell me the TOTAL of room with crafting ressource in it. The Script store the number of each available ressource in the mud. The data before the value change are green. So, if i'm trying to get craft some FLARESTONE ( Wich is atm at 005 room with this ressource) Once i craft some FLARESTONE, i type system again to see if the number of room with FLARESTONE is still to 005. If it goes to 004 room, the data FLARESTONE - 005 will change color and go red. So i know there is no more ressource in this room. When i swich room, i type system again, and the FLARESTONE - 004 return GREEN because i have update it.

It also keep trap of what ressource i have got in my current craft as well i keeping track of the percent i gain on this given craft.




Now, with CMUD, yes, already have run the compatibility report. All the error are with the BRACE it seem. I have remove all the brace where i got an error. When i got the script to run without error, i save the whole thing, check my main mud windows and get.. when i type system.



Sectors with Resources by Type:
----------------------------------------------------------------------------------------------------
Pine - 023 :
Cedar - 012 :
Spruce - 010 :
Oak - 006 :
Ironwood - 006
Tin - 018 : Copper - 010 : Iron - 010 : Adamant - 011 : Mithral - 009
Fish - 015 : Mollusk - 003 : Saberfish - 006 : Squid - 004 : Oyster - 000
Amethyst - 020 : Emerald - 018 : Ruby - 011 : Sapphire - 008 : Diamond - 003
Sandstone - 026 : Basalt - 013 : Marble - 012 : Quartz - 012 : Obsidian - 005
Mushroom - 021 : Moss - 008 : Threadwort - 013 : Sliverweed - 007 : Sageleaf - 006
Coal - 022 : Salt - 010 : Sulfur - 016 : Lodestone - 006 : Flarestone - 005
Edible - 017 : Furry - 015 : Feathered - 006 : Venomous - 010 : Horned - 010

<568H 696M 203V 2450148X 06:15:15 100S 203E> Huh?!?

<568H 696M 203V 2450148X 06:15:16 100S 203E> Huh?!?

<568H 696M 203V 2450148X 06:15:17 100S 203E> Huh?!?


Only the first one fire.. and its not going correctly. The other one stay the normal way. And it also fire 3 something like a simple trigger, resulthing in a Huh?!? on the mud prompt. And i dont know what the word or whatever is launch cuz i dont saw anything launch. Only space then... Huh?!?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net