Doom989 Posted March 9, 2013 Share Posted March 9, 2013 Having more trouble with my code. At the moment, it constantly decides its in an encounter no matter which unique color i choose on the battle screen. There arnt any similar colors outside of the encounter. var x, y: Integer; begin repeat Wait(600) if Findcolor(x,y,2565949,815, 422,826, 427)then begin writeLn('Encounter!') wait(2000) ClickMouse(385,525,mbLeft); writeln('click fight.') wait(1500) ClickMouse(385,525,mbLeft); writeln('waiting for turn to end') Wait(9500) until False; end; end. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted March 9, 2013 Share Posted March 9, 2013 Umm.. I looked to about 2 seconds to see that multiple lines were never ended by a ; Sooo.. Could be it? Haha, If you fix all of that and still an error, I will look further. Quote Link to comment Share on other sites More sharing options...
Doom989 Posted March 9, 2013 Author Share Posted March 9, 2013 Attempted what you said to no avail, but I really don't think its that. I've used findcolor like this in other scripts(elements the game) and its worked great. But for some reason isn't working in this game. It always acts like it found the color when its not possible. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted March 9, 2013 Share Posted March 9, 2013 You have added end; AFTER the "until False;" part - thats incorrect place, it should BEFORE "until False;" Working code (added standards in): var x, y: Integer; begin repeat Wait(600); if Findcolor(x, y, 2565949, 815, 422, 826, 427) then begin WriteLn('Encounter!'); Wait(2000); ClickMouse(385, 525, mbLeft); WriteLn('click fight.'); Wait(1500); ClickMouse(385, 525, mbLeft); WriteLn('waiting for turn to end'); Wait(9500); end; until False; end. So, if you move that end; from line 17 to line 16 (swap with until), your code compiles. -Jani Quote Link to comment Share on other sites More sharing options...
Doom989 Posted March 9, 2013 Author Share Posted March 9, 2013 (edited) Ah. Thank you but i forgot to change the script i first posted. I took a bulk of TypeText out to make this shorter and muddled the ordering. The code compiles but refuses to actually check if the color is there or not. it constantly thinks its found it. Is it possible that its due to having dual monitors? Edited March 9, 2013 by Doom989 Quote Link to comment Share on other sites More sharing options...
Janilabo Posted March 9, 2013 Share Posted March 9, 2013 SCAR Divi should work just fine with dual monitors.. Freddy added support for dual monitors already few years ago. So no, it shouldn't be the problem - of course it could be, but most likely the problem is something in your code. You could try and debug what it finds from that spot where it keeps finding the color from. See, if there is actually your color somewhere. Debug the coordinates where it finds the color, and manually check those coordinates.. Quote Link to comment Share on other sites More sharing options...
Doom989 Posted March 9, 2013 Author Share Posted March 9, 2013 I'm 100% certain the color doesn't appear in the area i designate. Normal color is a solid green, when in an encounter its solid red. even when on solid green its running the if statement saying its in an encounter. I've tried numerous locations and colors that cannot coincide. Yet the script still isn't working. Quote Link to comment Share on other sites More sharing options...