Jump to content
Doom989

Small problem with code.

Recommended Posts

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.   

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Doom989
Link to comment
Share on other sites

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.. :P

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...