haidargubbe Posted January 19, 2014 Share Posted January 19, 2014 (edited) Hi! ive made my first script and its running i need to add one more procedure but i want it to click on a color:Color Picked: 8163998 at (142, 112) How do i make that happend? here is the script Edited January 19, 2014 by haidargubbe Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 (edited) Which SCAR version are you using? Do you need to look at the color from same coordinates or does the color appear randomly in an area? Also, to which parts do you need color detection? Moving/picking procedures? Your current script can be shortened quite a bit: program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, False); Wait(500); ClickMouse(276, 770, False); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, False); Wait(1000); end; procedure Play; var h, i: Integer; begin h := High(path); repeat for i := 0 to h do begin Move(path[i]); Pick; end; until False; end; begin Setup; Play; end. Edited January 19, 2014 by Janilabo Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 Which SCAR version are you using?Do you need to look at the color from same coordinates or does the color appear randomly in an area? Also, to which parts do you need color detection? Moving/picking procedures? Your current script can be shortened quite a bit: program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, False); Wait(500); ClickMouse(276, 770, False); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, False); Wait(1000); end; procedure Play; var h, i: Integer; begin h := High(path); repeat for i := 0 to h do begin Move(path[i]); Pick; end; until False; end; begin Setup; Play; end. i need to click on a color that is on a same spot .. scar version 3,40 Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 i need to click on a color that is on a same spot .. scar version 3,40 Well, I would need great details to work it out.. What is the same spot? Anyways, would either of these 2 codes work (probably wont, but give em a try and maybe modify yourself): Code 1: program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, mbLeft); Wait(500); ClickMouse(276, 770, mbLeft); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, mbLeft); Wait(1000); end; procedure Detection; var x, y: Integer; begin if FindColor(x, y, 8163998, 132, 102, 152, 122) then begin MoveMouse(x, y); Wait(250); ClickMouse(x, y, mbLeft); Wait(500); end; end; procedure Play; var h, i: Integer; begin h := High(path); repeat for i := 0 to h do begin Detection; Move(path[i]); Pick; end; until False; end; begin Setup; Play; end. Code 2: program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, mbLeft); Wait(500); ClickMouse(276, 770, mbLeft); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, mbLeft); Wait(1000); end; procedure Detection; begin if (GetColor(142, 112) = 8163998) then begin MoveMouse(142, 112); Wait(250); ClickMouse(142, 112, mbLeft); Wait(500); end; end; procedure Play; var h, i: Integer; begin h := High(path); repeat for i := 0 to h do begin Detection; Move(path[i]); Pick; end; until False; end; begin Setup; Play; end. Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 i dont understand ur type of script but do u have skype so i can show u ? - - - Updated - - - First code works but i need it to double-click,, what is mbleft? and after the click i nee movemouse to another location and click once! Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 i dont understand ur type of script but do u have skype so i can show u ? - - - Updated - - - First code works but i need it to double-click,, what is mbleft? and after the click i nee movemouse to another location and click once! mbLeft means Mouse Button LeftYou need em to be right? Then you can just change em to mbRight which is Mouse Button Right. program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, mbLeft); Wait(50 + Random(35)); ClickMouse(276, 770, mbLeft); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, mbLeft); Wait(1000); end; procedure Detection; var x, y: Integer; begin if FindColor(x, y, 8163998, 132, 102, 152, 122) then begin MoveMouse(x, y); Wait(250); ClickMouse(x, y, mbLeft); Wait(50 + Random(35)); ClickMouse(x, y, mbLeft); Wait(500); end; end; procedure Play; var h, i: Integer; begin h := High(path); repeat for i := 0 to h do begin Detection; Move(path[i]); Pick; end; until False; end; begin Setup; Play; end. With double-clicking.. Add the mouse movement and click to that another place yourself.. Should not be hard? Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 begin if FindColor(x, y, 8163998, 132, 102, 152, 122) then begin MoveMouse(136, 111); Wait(250); ClickMouse(136, 111, mbLeft); ClickMouse(136, 111, mbLeft); Wait(500); MoveMouse(736, 605); Wait(500) ClickMouse(736, 605, mbLeft); When i get here it dosnt click the mouse it just moves the mouse ClickMouse(136, 111, mbLeft); end; Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 begin if FindColor(x, y, 8163998, 132, 102, 152, 122) then begin MoveMouse(136, 111); Wait(250); ClickMouse(136, 111, mbLeft); ClickMouse(136, 111, mbLeft); Wait(500); MoveMouse(736, 605); Wait(500) ClickMouse(736, 605, mbLeft); When i get here it dosnt click the mouse it just moves the mouse ClickMouse(136, 111, mbLeft); end; Add small delay (Wait) between the 2 clicks. It sounds like it is right now working a bit too fast for your game (wont accept the input with so small delay). Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 (edited) Add small delay (Wait) between the 2 clicks. It sounds like it is right now working a bit too fast for your game (wont accept the input with so small delay). evrything works now but only thing is when it finds teh color in the beggining it dosnt click the color it clicks the cordinates , ps. the color can move .. and how do i make the (accepting task) (clicking the color) only in the begging of the script so it dosnt click the color evry round.. do i need to remove detection from repeat? begin h := High(path); repeat for i := 0 to h do begin Detection; if i remove it from here. will the script stop clicking this evry round and just click once in the beggining? and when done with path? Move(path); Pick; end; until False; end; Edited January 19, 2014 by haidargubbe Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 (edited) evrything works now but only thing is when it finds teh color in the beggining it dosnt click the color it clicks the cordinates , ps. the color can move .. and how do i make the (accepting task) (clicking the color) only in the begging of the script so it dosnt click the color evry round.. do i need to remove detection from repeat? begin h := High(path); repeat for i := 0 to h do begin Detection; if i remove it from here. will the script stop clicking this evry round and just click once in the beggining? and when done with path? Move(path); Pick; end; until False; end; Show me your current script? I can change it to click the color instead...please use code-tags: [c0de]code goes here[/c0de] (replace 0's with o's) Also please give me the area where the color for detection can possibly be/appear. Edited January 19, 2014 by Janilabo Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 (edited) program mining; Edited January 19, 2014 by haidargubbe Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, mbLeft); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, mbLeft); Wait(1000); end; procedure Detection; var x, y: Integer; begin if FindColor(x, y, 8163998, 94, 43, 171, 779) then begin MoveMouse(136, 111); Wait(250); ClickMouse(136, 111, mbLeft); ClickMouse(136, 111, mbLeft); Wait(500); MoveMouse(736, 605); Wait(500) ClickMouse(736, 605, mbLeft); Wait(500) end; end; procedure Play; var h, i: Integer; begin h := High(path); repeat for i := 0 to h do begin Detection; Move(path); Pick; end; until False; end; begin Setup; Play; end. Please, I told you to use code-tags... Without code-tags you will get rid of standards and also there's a lot more scrolling for forums involved. Anyways, here is the code with some edits, is it doing finally what you need - or possibly even getting closer to it? program mining; var U, D, L, R: TPoint; path: TPointArray; procedure Setup; begin U := Point(639, 702); D := Point(639, 780); L := Point(599, 739); R := Point(676, 738); path := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U]; end; procedure Pick; begin Wait(1000); MoveMouse(276, 770); Wait(1000); ClickMouse(276, 770, mbLeft); Wait(50 + Random(35)); ClickMouse(276, 770, mbLeft); end; procedure Move(coordinates: TPoint); begin MoveMouse(coordinates.X, coordinates.Y); Wait(1000); ClickMouse(coordinates.X, coordinates.Y, mbLeft); Wait(1000); end; procedure Detection; var x, y: Integer; begin if FindColor(x, y, 8163998, 94, 43, 171, 779) then begin MoveMouse(x, y); Wait(250); ClickMouse(x, y, mbLeft); Wait(50 + Random(35)); ClickMouse(x, y, mbLeft); Wait(500); MoveMouse(736, 605); Wait(500); ClickMouse(736, 605, mbLeft); Wait(500); end; end; procedure Play; var h, i: Integer; begin h := High(path); repeat Detection; for i := 0 to h do begin Move(path[i]); Pick; end; until False; end; begin Setup; Play; end. Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 Maaaan!! you the best! now its flawless! my first script.. and i love it! Quote Link to comment Share on other sites More sharing options...
Janilabo Posted January 19, 2014 Share Posted January 19, 2014 Maaaan!! you the best! now its flawless! my first script.. and i love it! Hehe, happy to hear I was able to help you out! Hopefully I was able to teach you some new tricks aswell. Quote Link to comment Share on other sites More sharing options...
haidargubbe Posted January 19, 2014 Author Share Posted January 19, 2014 Ofc you was and now i want to make another script do u have skype that script is full of just clicking color and i cant figure out how u made it click on colors:) Quote Link to comment Share on other sites More sharing options...