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
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Sat Nov 06, 2004 3:19 pm   

align/autoremove/autowear script
 
Using my script below i need some modifications help.
The following script works great but i need it to function differently.

depending on my align evil / netural / good i can wear certain eq.

the following script works great if i'm netural going good or good going netural. I can use the list to remove eq and store in a container. What i need to be able to do is to have 2 lists one for when i'm going good and one for when i'm going evil as either direction forces me to wear different eq.

for instance if i'm netural (perferred) and i'm going good i need to remove abc/def/ghi. however if i'm going evil i need to remove qrs/tuv/wxy. and when i return to netural i need to also re-wear the eq i just took off and stored in the container.

Any help is very appriciated.


Last edited by dcb on Sat Nov 06, 2004 5:24 pm; edited 2 times in total
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Sat Nov 06, 2004 5:11 pm   
 
okay actually the script is not working too well when it comes to my align going evil or evil to netural. It only appears to work if i'm netrual going to good and good going to netural. netural = -350 to 350 good 351-1000 evil -351 to -1000

align would show -341 or 341

seems i'm having problems with the negitave numbers. turning on triggers in zmud this is what is displayed.

[^Hit:%d/%d MVS:%d/%d A:(%n)-> #IF ((-341<340) and (@RemEq)) {
#ECHO {%ansi( high, green)You have regained neutrality. Wearing EQ}
#FORALL @RemEqList {
rm
rem phaser
get %i monkey
wear %i
put phaser monkey
wm
}
#VAR RemEq 0
}
#IF (( -341>300) and ( -341<340)) {#IF (%abs( -341)>@LastAlign) {#ECHO {%ansi( yellow)Warning! You are losing neutrality!}}}
#IF (-341>339) {
#IF !(@RemEq) {
#ECHO {%ansi( high, red, blink)You have lost neutrality! Removing EQ!}
#VAR RemEQ 1
#FORALL @RemEqList {
rm
get phaser monkey
remove %i
put %i monkey
wield phaser
wm
}
}
}
LastAlign=-341]


now keep in mind that i'm not real savy with math or negagive numbers. So the figures above may just be off the wall for what i'm trying to accomplish. In real basic terms if my align is -340 to 340 i want to wear eq1 eq2 eq3 if align goes to -341 to 341 i want to change eq eq1 eq2 eq3 and if align goes to 341 to 1000 i want to change eq again.

the script above works 100% if i'm netural going good or good going netural it's when i'm going evil or evil to netural is where i'm having problems.

what a frustration!

Thanks for any help
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Sat Nov 06, 2004 6:50 pm   
 
Well.. I got it to work fine with switching between aligns.. now's just the issue of entering the commands you want at the specific occasions...

I used 2 variables Align and LastAlign to compare to eachother so to determine from which align you're going whence. Could be useful in the future for other use. Anyway. Here's the code.

Code:

#VAR LastAlign {342}
#VAR Align {320}
#TRIGGER {^Hit:%d/%d MVS:%d/%d A:(%n)} {#var LastAlign @Align;#var Align %1}
#TRIGGER {@Align} {
  #IF (@Align <= -341 AND @LastAlign >= -340) {#Echo Going Evil from Being Neutral};
  #IF (@Align >= 340 AND @LastAlign <= 339) {#Echo Going Good from Being Neutral};
  #IF (@Align >= -340 AND @LastAlign < -340) {#Echo Going Neutral from Being Evil};
  #IF (@Align <= 340 AND @LastAlign > 340) {#Echo Going Neutral from Being Good}
  }


Hope it helps. (I deliberately chose to indent the code here to make it easier to read in the forum...)
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Sun Nov 07, 2004 12:43 am   
 
This did not work at all for me :( When i started this project i really thought it would be no big deal boy was i wrong.

Maybe one of the guru's will be able to understand and help write this script? I'd sure appriciate it.


misterbalrog wrote:
Well.. I got it to work fine with switching between aligns.. now's just the issue of entering the commands you want at the specific occasions...

I used 2 variables Align and LastAlign to compare to eachother so to determine from which align you're going whence. Could be useful in the future for other use. Anyway. Here's the code.

Code:

#VAR LastAlign {342}
#VAR Align {320}
#TRIGGER {^Hit:%d/%d MVS:%d/%d A:(%n)} {#var LastAlign @Align;#var Align %1}
#TRIGGER {@Align} {
  #IF (@Align <= -341 AND @LastAlign >= -340) {#Echo Going Evil from Being Neutral};
  #IF (@Align >= 340 AND @LastAlign <= 339) {#Echo Going Good from Being Neutral};
  #IF (@Align >= -340 AND @LastAlign < -340) {#Echo Going Neutral from Being Evil};
  #IF (@Align <= 340 AND @LastAlign > 340) {#Echo Going Neutral from Being Good}
  }


Hope it helps. (I deliberately chose to indent the code here to make it easier to read in the forum...)
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Sun Nov 07, 2004 7:27 am   
 
What I noticed was that you have [] brackets in there.

I'm sure that's just how you copied it, but how about you make a fresh start? remove or disable those old triggers and try again? Cuz I find no faults if your prompt is just this:

Hit: 123/123 MVS: 123/123 A:-123

If you have more after Align, just add * there. The []-brackets evaluate the expressions within them, which can cause trouble from time to time unless you know what you're doing. Leading me to suspect that your align is being evaluated to an absolute value and never treated as a negative. (which you also do with using %abs) matching %abs(-341) with 341 will return true because what it compares with there is 341 to 341.

Besides, alot of your code is missing. Because I can't see when you're defining the variable LastAlign in your pasted code. Export your code in Settings -> Export and copy from the text-file. If that's what you've done. I highly recommend you start over.
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sun Nov 07, 2004 5:52 pm   
 
dcb - I don't know if you used my suggestions exactly as written in http://forums.zuggsoft.com/phpbb/viewtopic.php?p=73427&highlight=#73427, or someone else's for your prompt trigger.
It is very frustrating for me to be spoon-fed bits and pieces of information while you try to build a script because the solution I/we provide for an intermediate step won't necessarily work for the completed script.
The solution I provided for prompt trigger messages might not be able to handle what you're trying to do in this script. Had you provided all the information and expected functionality in your first post for assistance, this would have been an easy script.
We will all continue to try to help in any way possible, but in the future, please provide the ultimate functionality expected, so we don't have to back up and rewrite parts that won't work with 'the next thing.
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Fri Nov 12, 2004 7:33 pm   Lets see if we can make it work with this
 
Yes i did actually and it did work for what it does but it's not what im trying to do.

Let me start again.

Here is my current script. This works just fine if i'm netural going good or good going netural the problem is when i am about to turn evil nothing happens.

I need this script to work no matter which direction i go. So if i am say -325 i need to remove my eq store in container. if i reach -324 i need to get eq from container and wear it. Likewise if i'm 325 i need to remove eq store in container and if i'm 324 i need to get eq from container and wear it. Nothing needs to happen if i'm within these limits.

I understand your frustration and i'm just not savy when it comes to trying to explain this but honestly i'm trying.


#IF ((%1 < 340) and (@RemEq)) {
#ECHO {%ansi( high, green)You have regained neutrality. Wearing EQ}
#FORALL @RemEqList {
rm
rem phaser
get %i monkey
wear %i
put phaser monkey
wm
}
#VAR RemEq 0
}
#IF (( %1 > 300) and ( %1 < 340)) {#IF (%abs( %1) > @LastAlign) {#ECHO {%ansi( yellow)Warning! You are losing neutrality!}}}
#IF (%1 > 330) {
#IF !(@RemEq) {
#ECHO {%ansi( high, red, blink)You have lost neutrality! Removing EQ!}
#VAR RemEQ 1
#FORALL @RemEqList {
rm
get phaser monkey
remove %i
put %i monkey
wield phaser
wm
}
}
}
LastAlign=%1



mr_kent wrote:
dcb - I don't know if you used my suggestions exactly as written in http://forums.zuggsoft.com/phpbb/viewtopic.php?p=73427&highlight=#73427, or someone else's for your prompt trigger.
It is very frustrating for me to be spoon-fed bits and pieces of information while you try to build a script because the solution I/we provide for an intermediate step won't necessarily work for the completed script.
The solution I provided for prompt trigger messages might not be able to handle what you're trying to do in this script. Had you provided all the information and expected functionality in your first post for assistance, this would have been an easy script.
We will all continue to try to help in any way possible, but in the future, please provide the ultimate functionality expected, so we don't have to back up and rewrite parts that won't work with 'the next thing.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Nov 13, 2004 2:28 am   
 
I am thoroughly sick of this topic. So I decided I would once again try to answer you after having my previous solution to your similar question rejected. I got into reformatting your posted code into something I could work with and realized that the problem is quite simple.

#IF ((%1 < 340) and (@RemEq)) {

Your first line of code; during all cases in which: alignment is less then 340 (including those -1 to -100000000000000000) and RemEq is also non-zero, match this condition. Since nothing you have posted indicates how RemEq is set I must assume that you have other scripts that are causing the problem. Please don't try and make us be mind readers, we are not very good at it; as should be evidenced by this topic remaining unresolved for 2 weeks.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Sat Nov 13, 2004 5:09 am   
 
I'm sorry that i'm not an expert with zmud scripting as you appearntly are and that my frustrations irriate you to the point your sick.

I posted the entire script in the previous post. There are no assumptions what so ever. I simply created a variable called remeq and the script toggles this variable to 0 or 1 as it shows in the script itself. I tried for hours to incorporate your previous solution into my script and was unsuccessful as my continued posts about this script prove.

I never said that my script was correct i simply stated that it works perfectly ** IF ** my align is a number ranging from 0 to 325 and it did not work if my align was 0 to -325.

Your help is greatly appriciated as it is quite obvious i cannot do this on my own or I would have already done so.

Still yet with your most recent post i don't understand what the problem is I'm glad you see it however i reamin with a broken script.


I have written in these posts exactly what i'm looking for and posted my code (with the help of others as well) showing what i've done to this point. Perhaps if there is a "guru" who isn't as sick as you are reading this they might just scrap the script and help me re-write it from scratch to suit my needs.

If not, i'll remain with a broken script and move on to better things.

Thanks for all your time you've invested.

Darwin

Vijilante wrote:
I am thoroughly sick of this topic. So I decided I would once again try to answer you after having my previous solution to your similar question rejected. I got into reformatting your posted code into something I could work with and realized that the problem is quite simple.

#IF ((%1 < 340) and (@RemEq)) {

Your first line of code; during all cases in which: alignment is less then 340 (including those -1 to -100000000000000000) and RemEq is also non-zero, match this condition. Since nothing you have posted indicates how RemEq is set I must assume that you have other scripts that are causing the problem. Please don't try and make us be mind readers, we are not very good at it; as should be evidenced by this topic remaining unresolved for 2 weeks.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Nov 13, 2004 12:39 pm   
 
I went back to your original post and started from there. I then integrated most everything you posted here. I am assuming you haven't changed your prompt since that old post. What I didn't integrate was your method of removing and wearing eq. It seems like you are issuing far too many commands for such a task, so I just put in some #ECHOs saying do it here.

#CLASS {AutoAlignEQ}
#VAR LastAlign {0}
#VAR EQSet {}
#TRIGGER "AlignmentWarn" {^HIT:%d/%d MVS:%d/%d A:({-|})(%d) EXLVL:%d} {#IF (%2>=340) {#IF (%2>@LastAlign) {#IF (@EQSet="") {#ECHO {%ansi( high, red, blink)You have lost neutrality! Removing EQ!};#IF (%1="") {EQSet="+";#ECHO {Remove neutral eq and wear good eq here}} {EQSet="-";#ECHO {Remove neutral eq and wear evil eq here}}}}} {#IF (%2>@LastAlign) {#IF (%2>300) {#ECHO {%ansi( yellow)Warning! You are losing neutrality!}}} {#IF (%2<@LastAlign) {#IF (@EQSet) {#ECHO {%ansi( high, green)You have regained neutrality. Wearing EQ};#IF (@EQSet="-") {EQSet="";#ECHO {Remove evil eq and wear neutral eq here}} {EQSet="";#ECHO {Remove good eq and wear neutral eq here}}}}}};LastAlign=%2}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Tue Nov 16, 2004 12:58 am   Finally!
 
This worked like a champ!

Thank you sooooo much for the help!
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