Cond questions
Posted: March 28th, 2012, 5:17 pm
So ive been trying to figure out how to get cond to work in a test script and im clueless at this point. Ive read the cubescript reference page, and im familiar with the "else if" statement.. Ive probably editted this script over 60 times trying to get it to work, and decided to post it here to get some help.. Im not asking you to write the script just point out the flaws, so i can figure out what goes where, which containers to use and when.. Or if using another method would be better. I thought about using case but i dont understand it fully.. Anyways here's the script
*Editted the brackets, but the cond still isnt working. The problem starts at the if statement. I dont know if im using in the correct way.. Do i need the if statement to run the cond?
Code: Select all
r_script_signal interact [
r_global_set $item_counter (+ (r_global_get $item_counter) 1)
echo The item counter is at (r_global_get $item_counter)
if (= (r_global_get $item_counter) $itemlvl) [
itemlvl = [
cond [= ((r_global_get $item_counter)) 10] [
echo "you have gained a level with this item"
] [= ((r_global_get $item_counter)) 15] [
echo "you have gained a level with this item"
] [= ((r_global_get $item_counter)) 25] [
echo "you have gained a level with this item"
]
]
]
*Editted the brackets, but the cond still isnt working. The problem starts at the if statement. I dont know if im using in the correct way.. Do i need the if statement to run the cond?