sanjarmax1 Posted September 11, 2014 Share Posted September 11, 2014 Hey everyone, i learned the basics of this program and now i have a problem with some script that i made by my own .. please help me ! the error says "Invalid search area Line 14" (first line of FindColor function) program New; var Int: Integer; w,x,y,z : Integer; begin Int := 0; repeat for Int := 1 to 100000 do; if (FindColor(x,y,11972407,410, 213,409, 547) or (FindColor(x,y,11380276,410, 213,409, 547) or (FindColor(x,y,12301369,410, 213,409, 547) or (FindColor(x,y,11578418,410, 213,409, 547) or (FindColor(x,y,10657325,410, 213,409, 547) or (FindColor(x,y,12828476,518, 100,521, 543) or (FindColor(x,y,12499258,518, 100,521, 543) or (FindColor(x,y,12630331,518, 100,521, 543) or (FindColor(x,y,13749058,518, 100,521, 543) or (FindColor(x,y,13222207,518, 100,521, 543) or (FindColor(x,y,11972662,632, 103,631, 545) or (FindColor(x,y,11644213,632, 103,631, 545) or (FindColor(x,y,13090878,632, 103,631, 545) or (FindColor(x,y,11643445,632, 103,631, 545) or (FindColor(x,y,10919984,632, 103,631, 545) or (FindColor(x,y,12433721,740, 101,742, 545) or (FindColor(x,y,11381553,740, 101,742, 545) or (FindColor(x,y,12171831,740, 101,742, 545) or (FindColor(x,y,13354558,740, 101,742, 545) or (FindColor(x,y,11117361,740, 101,742, 545) or (FindColor(x,y,12301369,411, 323,851, 544) or (FindColor(x,y,12499258,411, 323,851, 544) or (FindColor(x,y,10920237,411, 323,851, 544) or (FindColor(x,y,13551681,411, 323,851, 544) or (FindColor(x,y,11841334,411, 323,851, 544) or (FindColor(x,y,12564283,963, 102,962, 542) or (FindColor(x,y,11512116,963, 102,962, 542) or (FindColor(x,y,14011972,963, 102,962, 542) or (FindColor(x,y,12894779,963, 102,962, 542) or (FindColor(x,y,13354559,963, 102,962, 542))))))))))))))))))))))))))))))) then begin Wait(500) ClickMouse(x,y,MbLeft) Wait(5000) ClickMouse(1000,620,MbLeft) Wait(20000) ClickMouse(1121,229,MbLeft) end else begin if (FindColor(x,y,3880906,435,100,975,525) or (FindColor(w,z,2632865,435,100,975,525) or (FindColor(w,z,2436784,435,100,975,525) or (FindColor(w,z,1252755,435,100,975,525) or (FindColor(w,z,2434729,435,100,975,525) or (FindColor(w,z,2567843,435,100,975,525) or (FindColor(w,z,2697387,435,100,975,525) or (FindColor(w,z,1319062,435,100,975,525) or (FindColor(w,z,2631589,435,100,975,525) or (FindColor(w,z,2304944,435,100,975,525) or (FindColor(w,z,2371243,435,100,975,525) or (FindColor(w,z,1055369,435,100,975,525) or (FindColor(w,z,1843100,435,100,975,525) or (FindColor(w,z,2238119,435,100,975,525) or (FindColor(w,z,1252495,435,100,975,525) or (FindColor(w,z,3880905,435,100,975,525) or (FindColor(w,z,858755,435,100,975,525) or (FindColor(w,z,2962113,435,100,975,525) or (FindColor(w,z,922499,435,100,975,525) or (FindColor(w,z,921962,435,100,975,525) or (FindColor(w,z,725620,435,100,975,525) or (FindColor(w,z,2237601,435,100,975,525) or (FindColor(w,z,1645713,435,100,975,525) or (FindColor(w,z,1713311,435,100,975,525) or (FindColor(w,z,2172068,435,100,975,525) or (FindColor(w,z,2042537,435,100,975,525) or (FindColor(w,z,2370461,435,100,975,525) or (FindColor(w,z,2567324,435,100,975,525) or (FindColor(w,z,2371246,435,100,975,525) or (FindColor(w,z,2566048,435,100,975,525))))))))))))))))))))))))))))))) then begin ClickMouse(w,z,MbLeft) Wait(5000) ClickMouse(1000,620,MbLeft) Wait(10000) ClickMouse(1250,650,MbLeft) Wait(10000) ClickMouse(1018,358,MbLeft) Wait(1000) ClickMouse(1018,358,MbLeft) end else begin ClickMouse(1022,409,MbLeft) Wait(5000) end; end; until Int=10000; end. Quote Link to comment Share on other sites More sharing options...
slacky Posted September 12, 2014 Share Posted September 12, 2014 (edited) because you give it an XS which is larger then XE. >>> 963,102, 962,542 That's a negative box since XS is greater then XE... ┌─────────┤YS├──────────┐ │░░░░░░░░░░░░░░░░░░░░░░░│ ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ XS│░░░░░░SEARCH░BOX░░░░░░░│XE ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ │░░░░░░░░░░░░░░░░░░░░░░░│ └─────────┤YE├──────────┘ ^ that is how the four values (two points) [xs,ys,xe,ye] defines the box you search in. Edited September 12, 2014 by slacky Quote Link to comment Share on other sites More sharing options...
sanjarmax1 Posted September 12, 2014 Author Share Posted September 12, 2014 because you give it an XS which is larger then XE.>>> 963,102, 962,542 That's a negative box since XS is greater then XE... ┌─────────┤YS├──────────┐ │░░░░░░░░░░░░░░░░░░░░░░░│ ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ XS│░░░░░░SEARCH░BOX░░░░░░░│XE ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ │░░░░░░░░░░░░░░░░░░░░░░░│ └─────────┤YE├──────────┘ ^ that is how the four coudinates [xs,ys,xe,ye] defines the box you search in. hmm i just swapped the XS with XE and YS with YE and it still shows the same problem.. can you tell me what i need to change it with ? i tried it even without changing the YS with YE but still the same .. 409,213,410,547 not working and 409,547,410,213 not working too .. any solutions ? Quote Link to comment Share on other sites More sharing options...
Janilabo Posted September 12, 2014 Share Posted September 12, 2014 hmm i just swapped the XS with XE and YS with YE and it still shows the same problem.. can you tell me what i need to change it with ? i tried it even without changing the YS with YE but still the same .. 409,213,410,547 not working and 409,547,410,213 not working too .. any solutions ?First off, parameter order: XS, YS, XE, YE (X-Start, Y-Start, X-End, Y-End) Examples with yours. 409[XS], 213[YS], 410[XE], 547[YE] <= that is fine! XS is NOT higher than XE and YS is NOT either higher than YE. The area however might be too small for your needs, because it is just 2-pixels wide (((410-409)+1)=2)! 409[XS], 547[YS], 410[XE], 213[YE] <= that is INCORRECT, you can clearly see YS is higher value than YE. It is not proper area. slacky provided you very useful example up there, it really should give you the idea how the "area logic" works. :\ Quote Link to comment Share on other sites More sharing options...
sanjarmax1 Posted September 12, 2014 Author Share Posted September 12, 2014 First off, parameter order: XS, YS, XE, YE (X-Start, Y-Start, X-End, Y-End) Examples with yours. 409[XS], 213[YS], 410[XE], 547[YE] <= that is fine! XS is NOT higher than XE and YS is NOT either higher than YE. The area however might be too small for your needs, because it is just 2-pixels wide (((410-409)+1)=2)! 409[XS], 547[YS], 410[XE], 213[YE] <= that is INCORRECT, you can clearly see YS is higher value than YE. It is not proper area. slacky provided you very useful example up there, it really should give you the idea how the "area logic" works. :\ how many pixels i need to set minimum in this program ? and why cant i have higher XS and YS then XE and XS ? - - - Updated - - - hmm i just tried to put 409,213,450,547 it still say this error but earlier i made an script with 650,200,650,200 and it worked .. any more ideas ? please help Quote Link to comment Share on other sites More sharing options...
slacky Posted September 13, 2014 Share Posted September 13, 2014 (edited) You need to take a dive in to the basics of programming, man... XS (X-Start) -> XE (X-End) YS (Y-Start) -> YE (Y-End) In what way would giving a start-point which is greater then the stop-point make sense? ┌─────────┤YS├──────────┐ │░░░░░░░░░░░░░░░░░░░░░░░│ ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ XS│░░░░░░SEARCH░BOX░░░░░░░│XE ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ │░░░░░░░░░░░░░░░░░░░░░░░│ └─────────┤YE├──────────┘ ^ look at that... ask yourself if you have a box, how can the TOP (YS) be lower down then the Bottom (YE)? It's impossible.. the top is always the top. So the top YS must ALWAYS be greater than or equal to the bottom YE. Something else does not make sense in this universe. - Gives up Edit: "Greater than the bottom" as in lower value/aka higher up on your screen. Edited September 13, 2014 by slacky Quote Link to comment Share on other sites More sharing options...
sanjarmax1 Posted September 13, 2014 Author Share Posted September 13, 2014 You need to take a dive in to the basics of programming, man... XS (X-Start) -> XE (X-End) YS (Y-Start) -> YE (Y-End) In what way would giving a start-point which is greater then the stop-point make sense? ┌─────────┤YS├──────────┐ │░░░░░░░░░░░░░░░░░░░░░░░│ ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ XS│░░░░░░SEARCH░BOX░░░░░░░│XE ─-┤░░░░░░░░░░░░░░░░░░░░░░░├-─ │░░░░░░░░░░░░░░░░░░░░░░░│ └─────────┤YE├──────────┘ ^ look at that... ask yourself if you have a box, how can the TOP (YS) be lower down then the Bottom (YE)? It's impossible.. the top is always the top. So the top YS must ALWAYS be greater then or equal to the bottom YE. Something else does not make sense in this universe. - Gives up hmm i just changed it to XS smaller than XE and YS bigger than YE and still not working .... any more ideas anyone ? i really need that thing to work ... Quote Link to comment Share on other sites More sharing options...
slacky Posted September 13, 2014 Share Posted September 13, 2014 (edited) hmm i just changed it to XS smaller than XE and YS bigger than YE and still not working .... any more ideas anyone ? i really need that thing to work ... I think you miss understood. `YS` (counting from top of your screen) should be greater than the bottom `YE`. Hmm.. Maybe just read over this thread a few times, you will probably get it (that is if you still struggle to understand this). Edited February 24, 2015 by slacky Quote Link to comment Share on other sites More sharing options...