 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Sat Nov 11, 2006 9:12 pm
Problem with parsing. Help?! |
I am using version 1.15, and I have a button which turns on automatic smoking of a certain pipe.
The value of the button is this:
#IF (@auto_aura == 1) {i_offaura} {i_onaura}
The value of alias "i_offaura" is this:
auto_aura = 0
#noop %btncol(btn_aura, red, gray)
i_info Auto Aura OFF
#delitem defs.free {anti-weapon field}
i_del lost_defs "anti-weapon field"
The value of alias "i_onaura" is this:
auto_aura = 1
#NOOP %btncol( btn_aura, @newcol)
i_info Auto Aura ON
#ADDITEM defs.free {anti-weapon field}
#IF (!%iskey( @defenses, anti-weapon field)) {
i_add lost_defs "anti-weapon field"
i_add scan pipes
i_scan_balance
i_scan_smoking
}
When I push the button all it will do is send the following to the output window.
#if (@able_scan and !%iskey(@afflictions, aeon) and @balanced == 1) {i_del scan balance;#if (%iskey(@auto, stand) and %iskey(@afflictions, prone) and !%iskey(@flags, standing) and @able_stand) {stand};#if (%iskey(@scan, pipe)) {i_scan_pipe};#if (@auto_breathing == 1 and !%iskey(@defenses, "held breath")) {hold breath};#if (%iskey(@auto, writhe) and %iskey(@afflictions, impaled) and !%iskey(@flags, writhing) and !%iskey(@flags, writhe_try)) {writhe} {#if (@no_reject != 1 and %numitems(%db(@flags, lusted)) > 0 and !%iskey(@flags, reject_try)) {reject %item(%db(@flags, lusted), 1)} {#if (%iskey(@scan, todo)) {i_scan_todo} {#if (%iskey(@scan, parry)) {i_scan_parry}}}}} 1
#if (%iskey(@auto, smoking)) {#if (!%iskey(@flags, smoking) and @able_scan and @able_smoke) {i_del scan smoking;i_pipe}} {i_del scan smoking} 1
These are the values of the aliases "i_scan_balance" and "i_scan_smoking" which are:
#if (@able_scan and !%iskey(@afflictions, aeon) and @balanced == 1) {i_del scan balance;#if (%iskey(@auto, stand) and %iskey(@afflictions, prone) and !%iskey(@flags, standing) and @able_stand) {stand};#if (%iskey(@scan, pipe)) {i_scan_pipe};#if (@auto_breathing == 1 and !%iskey(@defenses, "held breath")) {hold breath};#if (%iskey(@auto, writhe) and %iskey(@afflictions, impaled) and !%iskey(@flags, writhing) and !%iskey(@flags, writhe_try)) {writhe} {#if (@no_reject != 1 and %numitems(%db(@flags, lusted)) > 0 and !%iskey(@flags, reject_try)) {reject %item(%db(@flags, lusted), 1)} {#if (%iskey(@scan, todo)) {i_scan_todo} {#if (%iskey(@scan, parry)) {i_scan_parry}}}}}
and
#if (%iskey(@auto, smoking)) {#if (!%iskey(@flags, smoking) and @able_scan and @able_smoke) {i_del scan smoking;i_pipe}} {i_del scan smoking}
I ran syntax check but get no errors. I can't figure out what the problem is . Can someone tell me from that what is the problem? I'm pretty much a novice so if this is a stupid question then forgive me. |
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sat Nov 11, 2006 9:29 pm |
This is a general guide to debugging that might be useful because your code is quite long to debug:
1. Copy all these settings into a separate class (or package), disable the original class (or package) so you can play around with the copy.
2. Cut little bits out of the code until it works.
3. The last bit that you cut out is probably where the problem is, so test this part separatly, if you can, e.g. by making a test suite around it.
4. Either fix your code, or if there is a bug, post a bug report here. |
|
|
|
 |
|
|
|
|
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
|
|