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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
abu_monster
Newbie


Joined: 18 Jan 2006
Posts: 4

PostPosted: Wed Jan 18, 2006 1:38 am   

script help
 
Hello, i'm totaly new at this. I'm seeking help from someone to explain me why the script for fishing is not working in ZMuD version 7.21.
I have made some changes in it, but it does not do a loop.
-General problem is that after it catches a fish and recieves balance it foires baiting and casting at same time and by that stops automatism.
Here is the script:

#CLASS {Fishing}
#ALIAS fishoff {#T- Fishing}
#ALIAS fishon {#T+ Fishing;Fishing/casting = 0;Fishing/reeling = 0;Fishing/baiting = 0}
#CLASS 0
#CLASS {Fishing}
#VAR bait shrimp
#ALIAS dir {Fishing/direction = %1}
#ALIAS fish {outr @bait;bait pole with @bait;Fishing/balance = 0;Fishing/fishing = 0;Fishing/reeling = 0;Fishing/baiting = 0;Fishing/casting = 1;Fishing/swimback = 0;Fishing/polebaited = 1}
#ALIAS sf {Fishing/fishcaught = 0;sell fish to ivran;put gold in pouch}
#TRIGGER {You have recovered balance.} {Fishing/balance = 1; #IF (@casting) {cast pole @direction;Fishing/casting = 0;Fishing/balance = 0};#IF (@baiting) {Fishing/balance = 0;fish};#IF (@hooking) {hook fish;Fishing/hooking = 0;Fishing/balance = 0};#IF (@reeling) {reel;Fishing/balance = 0};#IF (@swimback) {#IF (@direction = "n") {swim s;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "s") {swim n;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "e") {swim w;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "w") {swim e;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "ne") {swim sw;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "sw") {swim ne;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "se") {swim nw;#wait (2500);fish;Fishing/swimback = 0};#IF (@direction = "nw") {swim se;#wait (2500);fish;Fishing/swimback = 0}}}
#TRIGGER {The fish gives a final hard yank against the line and breaks free.} {Fishing/reeling = 0;Fishing/baiting = 1}
#TRIGGER {With a final tug} {Fishing/reeling = 0;Fishing/casting = 0;Fishing/baiting = 1;#add Fishing/fishcaught 1}
#TRIGGER {You feel something strike at your bait.} {Fishing/hooking = 1;#IF (Fishing/@balance) {hook fish;Fishing/hooking = 0}}
#TRIGGER {You give your line a hard tug, and feel the hook sink in as the line goes taut.} {reel;Fishing/reeling = 1;Fishing/balance = 0}
#TRIGGER {You give your pole a hard yank, releasing your catch and reel in the line.} {Fishing/reeling = 0;Fishing/baiting = 1}
#TRIGGER {You feel a hard strike at your bait.} {Fishing/hooking = 1;#IF (@balance) {hook fish;Fishing/hooking = 0}}
#TRIGGER {You feel something nibbling at your bait.} {Fishing/hooking = 1;#IF (Fishing@balance) {hook fish;Fishing/hooking = 0}}
#TRIGGER {Your line goes taut as a fish takes the bait and is hooked.} {reel;Fishing/reeling = 1}
#TRIGGER {^You give your line a hard tug, but fail to hook anything.} {Fishing/polebaited = 0;p pole}
#TRIGGER {^This pole is baited with a {disgusting grub.|large shrimp.|wriggling worm.}} {Fishing/polebaited = 1}
#TRIGGER {^It bears the distinctive mark of} {#WAIT (250);#IF (@polebaited = 0) {reel;fish}}
#TRIGGER {^Your pole is viciously yanked, and you go tumbling head over heels into the} {Fishing/fishing = 0;Fishing/reeling = 0;Fishing/baiting = 0;Fishing/casting = 0;Fishing/polebaited = 0;Fishing/swimback = 1}
#KEY ALT-1 {#if (@bait = "worm") {Fishing/bait = grub;#echo Bait changed to Grub} {#if (@bait = "grub") {Fishing/bait = shrimp;#echo Bait changed to Shrimp} {#if (@bait = "shrimp") {Fishing/bait = worm;#echo Bait changed to Worm}}}}
#STAT { - Fish Caught: @fishcaught}
#CLASS 0
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Jan 18, 2006 4:20 am   
 
Probably a clash between the #ALIAS fish setting Fishing/casting = 1 and the balance trigger #TRIGGER {You have recovered balance.}

As well change all your #WAIT to #ALARM. As the #WAIT command ceases matching triggers for that time period maybe it tries to process two triggers (causing the clash) at the same time.

Thats where I'd start trouble shooting.
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Wed Jan 18, 2006 8:05 am   
 
I couldn't help but notice that you have your fishon and fishoff aliases inside the class that they enable and disable. That is potentially a problem in itself.
Reply with quote
abu_monster
Newbie


Joined: 18 Jan 2006
Posts: 4

PostPosted: Thu Jan 26, 2006 1:25 pm   IF command does funny thing
 
A question: WHY IF COMMAND INSTEAD OF DOING NOTHING FIRES EVEN THOUGH IT HAS VALUE 0 OR VALUE WHICH IS NOT DEFINED?
I have made following script:
#CLASS Battlescripts
#ALIAS kelpon {#T+ Battlescripts|Kelplock}
#ALIAS kelpoff {#T- Battlescripts|Kelplock}
#CLASS O
#CLASS Battlescripts|Kelplock
#ALIAS dk {envd;ctrl1}
#ALIAS envd {envenom dirk with}
#ALIAS kelplock {envd cyanide;envd ciguatoxin;envd iodine;envd bromine;envd botulinum;envd mercury;envd ether;envd arsenic;envd ciguatoxin;envd aconite}
#ALIAS ctrl1 {conjure illusion Khunkao pricks you twice in succesion with his dirk. Hmmmm. Why must everything be so difficult to figure out? Your body stiffens rapidly with paralysis.}
#ALIAS ctrl2 {conjure illusion Khunkao pricks you twice in succesion with his dirk. Terror descends upon you and your head swims - you must find shelter Hmmmm. Why must everything be so difficult to figure out?}
#ALIAS ctrl3 {conjure illusion A small black cobra opens its mouth wide and strikes you in the leg. You are confused as to the effects of the toxin.}
#ALIAS ctrl4 {conjure illusion Dart streaks from out of nowhere and slams into you. You are confused as to the effects of the toxin.}
#ALIAS ctrl5 {conjure illusion Khunkao pricks you twice in succesion with his dirk. Your limbs grow heavy and you groan feebly as weakness overcomes your body. You stumble and it becomes very difficult to concentrate on your coordination.}
#ALIAS ctrl6 {conjure illusion You are: Afflicted by horrible asthma. Afflicted with clumsiness.}
#ALIAS ctrl7 {conjure illusion Khunkao pricks you twice in succesion with his dirk. Your mind swims as dizziness overtakes you. A numbness seizes you, and your left arm goes limp.}
#ALIAS ctrl8 {conjure illusion Khunkao pricks you twice in succesion with his dirk. Your mind swims as dizziness overtakes you. A prickly, stinging sensation spreads through your body.}
#ALIAS ctrl9 {conjure illusion Khunkao pricks you twice in succesion with his dirk. You feel suddenly as if food is the most repulsive thing you can imagine. You watch, in horror, as your right arm shrivels up.}
#ALIAS ctrl10 {conjure illusion Khunkao pricks you twice in succesion with his dirk. Blood begins to slowly drip from your nose. Your ability to digest elixirs seems off for some reason}
#ALIAS ctrl11 {conjure illusion Khunkao pricks you twice in succesion with his dirk. A numbness seizes you, and your left arm goes limp. A numbness seizes you, and your left leg goes limp.}
#ALIAS ctrl12 {conjure illusion Khunkao pricks you twice in succesion with his dirk. A numbness seizes you, and your left leg goes limp. A numbness seizes you, and your right leg goes limp.}
#VAR Battlescripts/Kelplock/mental 0
#VAR Battlescripts/Kelplock/balance 1
#VAR Battlescripts/Kelplock/aura 0
#VAR Battlescripts/Kelplock/shield 0
#TRIGGER {You recovered balance} {#IF (@balancee 1) {dstb};#IF (@aura 1) {fla};#IF (@shield 1) {touch hammer &tar}}
#TRIGGER {you suddenly percieve the vague outline of an aura} {#VAR Battlescripts/Kelplock/aura 1;#VAR balance 0}
#TRIGGER {^You raze} {#VAR Battlescripts/Kelplock/aura 0;#VAR balance 1}
#TRIGGER {^A shimmering translucent shield forms around} {#VAR Battlescripts/Kelplock/shield 1;#VAR balance 0}
#TRIGGER {^You touch your tattoo and a massive, ethereal hammer rises up and shatters} {#VAR Battlescripts/Kelplock/shield 0;#VAR balance 1}
#TRIGGER {You have regained your mental equilibrium} {#IF (@mental 1) {dstb;#WAIT 200;ctrl5;#ADD Battlescripts/Kelplock/mental 1};#IF (@mental 2) {#WAIT 200;ctrl6;#ADD Battlescripts/Kelplock/mental 1};#IF (@mental 3) {#VAR Battlescripts/Kelplock/mental 0}}
#CLASS 0

The problem is just the last trigger. It goes normaly until it gets mental to 3, then sets it to 0 and repeats last illusion infinately.
Any suggestions would be nice.
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Thu Jan 26, 2006 2:28 pm   
 
SUGGESTION: Don't use #WAIT inside triggers.

SUGGESTION: Add something for #IF(@mental 0) in the last trigger.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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