|
Post by Silver Haze on Oct 28, 2004 19:51:11 GMT -5
Hi, well uh, i've read tiny terror's tutorial, but still i'm very new to this, and I don't really get everything, but most is clear.
I wanted a simple script that would auto-jump a target when i target it.
The If PixelGetColor thing is just for testing the script, if the pixels i enter in the coordinates are the right color, it should do the Jump() function, if the color's aren't right, it should just do If thing over and over.
$ScriptOn=1
While $ScriptOn=1 If PixelGetColor(113,994) 8191749 AND PixelGetColor(126,995) 8453891 AND PixelGetColor(132,1001) 8453896 Then AutoItSetOption("SendKeyDelay", 30); AutoItSetOption("SendKeyDownDelay", 050); Jump() $ScriptOn=2 Else $ScriptOn=1 EndIf WEnd
Func Jump() Send ("!1") Sleep(60000) $ScriptOn=1 EndFunc
When i try to run the script it gives me an error about the If statement, If ^ ERROR, Error: Error in expression.
Could anyone help me out?
|
|
|
Post by TinyTerror on Oct 28, 2004 20:03:14 GMT -5
Looks like you forgot the ='s between the PixelGetColor and the values you are checking. The if should look like this:
If PixelGetColor(113,994)=8191749 AND PixelGetColor(126,995)=8453891 AND PixelGetColor(132,1001)=8453896 Then
|
|
|
Post by Silver Haze on Oct 28, 2004 20:04:19 GMT -5
Hi, well uh, i've read tiny terror's tutorial, but still i'm very new to this, and I don't really get everything, but most is clear. I wanted a simple script that would auto-jump a target when i target it. The If PixelGetColor thing is just for testing the script, if the pixels i enter in the coordinates are the right color, it should do the Jump() function, if the color's aren't right, it should just do If thing over and over.
$ScriptOn=1 While $ScriptOn=1 If PixelGetColor(113,994) 8191749 AND PixelGetColor(126,995) 8453891 AND PixelGetColor(132,1001) 8453896 Then AutoItSetOption("SendKeyDelay", 30); AutoItSetOption("SendKeyDownDelay", 050); Jump() $ScriptOn=2 Else $ScriptOn=1 EndIf WEnd Func Jump() Send ("!1") Sleep(60000) $ScriptOn=1 EndFunc
When i try to run the script it gives me an error about the If statement, If ^ ERROR, Error: Error in expression. Could anyone help me out? I took a look at other script and discovered what was wrong, Currently it is this: $ScriptOn=1 $color_tar = 15790282 While $ScriptOn=1 If ((PixelGetColor(1192,879) == $color_tar) AND (PixelGetColor(1191,884) == $color_tar) AND (PixelGetColor(1194,880) == $color_tar)) Then AutoItSetOption("SendKeyDelay", 30); AutoItSetOption("SendKeyDownDelay", 050); Jump() $ScriptOn=2 Else $ScriptOn=1 EndIf WEnd Func Jump() Send ("!1") Sleep(60000) $ScriptOn=1 EndFunc Could anyone tell me if this would work? Or how i could test the script.
|
|
|
Post by TinyTerror on Oct 28, 2004 20:06:56 GMT -5
Go ahead and test it in-game. If you have any problems with it, we can work them out.
|
|
|
Post by Silver Haze on Oct 28, 2004 21:24:08 GMT -5
Well, i just tried it in-game, nothing happend Spook spawnd i targeted it, but he didn't do the macro it was supposed to do Send ("!1")
|
|
|
Post by TinyTerror on Oct 28, 2004 21:31:18 GMT -5
You might want to try setting your key delays to 300 or something. Often ffxi is a little slow picking up macro key presses, and will miss a short press. I hope you got the NM without the macro!
|
|
|
Post by Silver Haze on Oct 28, 2004 21:37:41 GMT -5
I'll try it, thanks.
I also added Sleep(100) below the Else statement, cause i think the script was going a little TOO fast and I had a major framerate drop (about 2 frames a sec... makes it kind of hard to play)
|
|
|
Post by TinyTerror on Oct 28, 2004 23:22:09 GMT -5
Yeah, putting PixelGetColor commands in a tight loop takes up all of your CPU. Putting a sleep in is a good idea.
|
|
|
Post by jtatauburn on Oct 28, 2004 23:30:11 GMT -5
how did you find out your pixel values? are you sure you're checking the correct pixels for color change?
|
|
|
Post by TinyTerror on Oct 28, 2004 23:40:47 GMT -5
|
|
|
Post by Silver Haze on Oct 29, 2004 6:44:50 GMT -5
I got the pixel coordinates and the pixel colors from the "My Spook Bot" topic in the AutoIt part, i believe those colors are correct.
|
|