View Single Post
  #6508    
Old February 23rd, 2012 (02:01 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Helfen, Wehren, Heilen
Crystal Tier
 
Join Date: Sep 2009
Location: Downia-upside
Age: 22
Gender: Male
Nature: Jolly
Posts: 1,322
Quote originally posted by SwiftSign:
Can anyone explain why this snippet of my XSE script won't work?

Quote:
...
addvar 0x10AA 0x1
copyvar 0x10AA 0x800D
compare 0x800D 0x3
if 0x1 call @2
...
I'm trying to make [compare] send the script to @2 when the variable 0x10AA reaches 3 (adding 1 in this script and 2 in another beforehand) however nothing happens - I'm not sure if its the adding which isn't working or my method of comparing the value :S.
The copyvar command is being used incorrectly, when you don't even need to use it at all. The first variable you put in copyvar is the destination while the second is the source (i.e the first variable copies the value of the second variable). In your script, variable 0x10AA will be taking on the value of 0x800D rather than the other way around, which is why the script will never work in the way you want it to. In addition, you don't need to copyvar 0x10AA to 0x800D at all, as the 'compare' command doesn't discriminate based on the variable used. Just use this:

Code:
...
addvar 0x10AA 0x1
compare 0x10AA 0x3
if 0x1 call @2
...
__________________