Tovar Posted April 24, 2012 Share Posted April 24, 2012 Well I have a little problem with my script, this script is about fish, you throw the bait and you need wait some seconds until appear the bubbles to catch the fish, well I want apart of this press a Key, but it have delay to use it again, HOW I CAN DO TO PRESS THE KEY AND START THE SCRIPT AGAIN WITHOUT WAIT HIS 20 SECONDS OF DELAY? program New; var x, y: integer; i:integer; begin i:=1; while (i < 5) do if FindColorTolerance (x, y, 16375555, 413, 98, 434, 105,40) or FindColorTolerance (x, y, 13413890, 413, 98, 434, 105,40) or FindColorTolerance (x, y, 9530881, 413, 98, 434, 105,40) then //color de la hp y coordenadas del pokemon en battle begin keydown(VK_f10) //hotkey a utilizar wait(200) keyup(VK_f10) wait(200) keydown(VK_control) wait(100) keydown(VK_down) wait(100) keyup(VK_down) wait(100) keydown(VK_up) wait(100) keyup(VK_up) wait(100) keyup(VK_control) end else begin i:=0; repeat keydown(VK_f11) Wait (300) ClickMouse (424, 117, true)// coordenadas del fishing spot1 wait(300) i:=i+1; //valor por ejecucion de la variable (0 = infinito) until(i = 1) //valor tope para que cambie de variable end; begin wait(300) wait(20000) keydown(VK_f5) end; end. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted April 24, 2012 Share Posted April 24, 2012 Heres an example, but there is many ways to do this and get the same result [scar] program New; Procedure ThrowBait; var x, y: integer; i:integer; begin i:=1; while (i < 5) do if FindColorTolerance (x, y, 16375555, 413, 98, 434, 105,40) or FindColorTolerance (x, y, 13413890, 413, 98, 434, 105,40) or FindColorTolerance (x, y, 9530881, 413, 98, 434, 105,40) then //color de la hp y coordenadas del pokemon en battle begin keydown(VK_f10) //hotkey a utilizar wait(200) keyup(VK_f10) wait(200) keydown(VK_control) wait(100) keydown(VK_down) wait(100) keyup(VK_down) wait(100) keydown(VK_up) wait(100) keyup(VK_up) wait(100) keyup(VK_control) end else begin i:=0; repeat keydown(VK_f11) Wait (300) ClickMouse (424, 117, true)// coordenadas del fishing spot1 wait(300) Inc(I); until(i = 1) //valor tope para que cambie de variable end; end; Procedure CheckKey; // this will run ever 100 ms in the background Begin SetTimeout(100,'CheckKey'); // this sets the timeout again ea time this is called. If IsFKeyDown(VK_f5) then // F% will restart the throw bait proc ThrowBait; end; Begin CheckKey; Repeat ThrowBait; Wait(20000); until False; end. [/scar] Quote Link to comment Share on other sites More sharing options...
Tovar Posted April 24, 2012 Author Share Posted April 24, 2012 Can you explain what you do more detailed? because it don't press the F5 Key. I want to press the F5 Key each "20 seconds" but I want this delay does not influence the Throwbait. Quote Link to comment Share on other sites More sharing options...