 |
DungeonCrawler Newbie
Joined: 29 Jul 2004 Posts: 4
|
Posted: Thu Jul 29, 2004 2:10 pm
Looping problems |
I am having problems with both #FORALL and #LOOPDB. I have tried them both, but I still get the odd behavior. I have two variables. The first is a string list of afflictions that I want to cure, all seperated by a "|", called "Afflictions". The second is called "Cures", and in the case of #FORALL, another string list composed of pairs of strings. The first of the pair is the affliction and the seconds is the cure for the affliction. When I use #LOOPDB, I use a datalist variable, the key is the affliction, and the val is the cure. The code appears as follows in the settings editor:
@Reflexes/Curing/IsCuring = 0
#LOOPDB @Reflexes/Curing/Cures {
#IF (!@Reflexes/Curing/IsCuring and @IsAfflicted(%key)) {
%val
@Reflexes/Curing/IsCuring = 1
}
}
The idea is that I loop through all of the afflictions in "Cures", use the function "IsAfflicted" to see if I am afflicted with the affliction. If I am, I execute "Key" to cure it. "IsCuring" is a control variable. I only want to cure once through the loop. Everything works fine, just like I want it to the first time the loop executes, it cures the first thing it sees then exits. After that, it executes "Key" twice on every other pass through the loop. I am at a loss. |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jul 29, 2004 5:08 pm |
Your problem isn't in the loop.
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
 |
DungeonCrawler Newbie
Joined: 29 Jul 2004 Posts: 4
|
Posted: Thu Jul 29, 2004 7:43 pm |
The command sent to the MUD as part of the "Key" will set off an input trigger. Can this be responsible for the wierdness?
|
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jul 30, 2004 12:41 am |
It might be. I really hate guessing with no information at all. Your problem is somewhere in the variables, triggers, and aliases that are used in conjunction with this loop. The only part of the script you've shown us doesn't have a problem. Without seeing the rest of the script there's really no way to tell where it is.
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
 |
DungeonCrawler Newbie
Joined: 29 Jul 2004 Posts: 4
|
Posted: Fri Jul 30, 2004 4:44 pm |
I apologize for not giving enough information, I didn't want to include things that weren't relevent. As I said, this loop is used for curing afflictions, and each affliction has a specific cure. I can only cure an affliction every few seconds, so I use an input trigger to catch when I send the curing command to the mud. I have another trigger which sets this variable to false when the mud tells me I can cure again. The input trigger sets a variable that is checked by the trigger which uses the curing alias. If it is true, then the loop is not executed.
|
|
|
|
 |
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Fri Jul 30, 2004 7:17 pm |
| Quote: |
| As I said, this loop is used for curing afflictions, and each affliction has a specific cure. I can only cure an affliction every few seconds, so I use an input trigger to catch when I send the curing command to the mud. I have another trigger which sets this variable to false when the mud tells me I can cure again. The input trigger sets a variable that is checked by the trigger which uses the curing alias. If it is true, then the loop is not executed. |
Restating irrelevant information does not make it relevant.
A paste of actual settings would be relevant, but at this point re-read LightBulb's last response if you want feedback.
| Quote: |
| I apologize for not giving enough information, I didn't want to include things that weren't relevent. |
We're here to help (not there) so if you still want some kind of resolution, please include everything. |
|
|
|
 |
|
|
|