BryceTheCoder Posted December 1, 2011 Share Posted December 1, 2011 Hey guys, i am trying to click the color: 3881790 my code looks like this for the color: if FindColor(x, y, 3881790, 0, 0, w - 1, h - 1) then Buuut on the screen pretty close to the actual thing i want it to click, there is another object with exact, if not similar, color and it alllwwaayys click the one i DONT want. Soo how cani fix this or make the color more specific or something? Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 1, 2011 Share Posted December 1, 2011 Somethings a screen capture so we can see what you are trying to do is worth a thousand words. Quote Link to comment Share on other sites More sharing options...
Main Posted December 1, 2011 Share Posted December 1, 2011 or teamviewer we could prolly do it pretty quick Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 1, 2011 Author Share Posted December 1, 2011 Ok, i got a video.. See how it click the workbench instead of the furnace, which i WANT the furnace instead of the workbench http://www.youtube.com/watch?v=pXlcDmKhhXs Both the furnace and the bench have the same color soooo im screwd:/ i need to know how to make it click furnace instead. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 1, 2011 Share Posted December 1, 2011 Is the OpenFurnace in OSI broken? program New; {$DEFINE RS2} {$DEFINE OSI_Color_Anti_Randoms} //{$DEFINE SMART} // Comment out to disable SMART {$I OSI\OSI.scar} {$I OSI\RS2\Skill\Smithing.scar} procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; OpenFurnace(Furnace_Falador, ClickLeft); end. Actually when testing this I did find a bug in Smithing.scar that will have to be fixed. Line 82 should read dtmOre_Any and not dtmOre. Oops. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 1, 2011 Author Share Posted December 1, 2011 im not using OSI. here.. tell me what i can do to fix my code into OSI so i can use what u gave me please. MY CODE NOW: //////////////////////////////////////////////////////////////////////CREATED BY: Bryce Raney // x = start here x //Start West Fally Bank (far right 1) [ ][][][][] //////////////////////////////////////////////////////////////////// program FallyCannonBalls; procedure LogMeOut; begin ClickWindMouse(754, 10, 4, 4, True); Wait(100 + Random(100)); ClickWindMouse(637, 406, 2, 2, True); Wait(99999999999999999999999999999999999999999999); end; procedure OpenBank; var w, h: Integer; x, y: Integer; begin GetClientDimensions(w, h); Begin if FindColor(x, y, 5991547, 0, 0, w - 1, h - 1) then WriteLn('--- FOUND BANK COLOR ---');//bank color = 5140363 MoveWindMouse(x, y, 1, 1); Wait(25 + Random(50)); ClickWindMouse(x, y, 1, 1, False); Wait(80 + Random(100)); ClickWindMouse(x, y+44, 1, 1, True); Wait(9999999 + Random(9000)); end; end; procedure MoveMouseRandom; var x, y: Integer; begin x := Random(400); Wait(250 + Random(150)); y := Random(300); Wait(50); MoveWindMouse(x, y, 25, 25); Wait(450 + Random(350)); end; procedure StartUp; begin Writeln('Starting Up...'); ClickWindMouse(543, 25, 8, 8, True); Wait(100 + Random(150)); SendArrowWait(0, 2100 + Random(750)); Wait(200 + Random(250)); end; procedure Walk2Furnace; begin Writeln('Walking to Furnace...'); ClickWindMouse(653, 41, 2, 2, True); Wait(5300 + Random(1000)); ClickWindMouse(688, 91, 2, 2, True); Wait(6000 + Random(1350)); ClickWindMouse(670, 121, 1, 1, True); Wait(5000 + Random(1835)); //ClickWindMouse(AAA, AAA, 2, 2, True); //Wait(AAAA + Random(AAAA)); Writeln('At Furnace.'); end; procedure UseFurnace; var w, h: Integer; x, y: Integer; begin GetClientDimensions(w, h); Begin if FindColor(x, y, 3815996, 0, 0, w - 1, h - 1) then WriteLn('!FOUND FURNACE COLOR!');//furnace color ClickWindMouse(621, 227, 2, 2, True);//click 2nd item slot ClickWindMouse(x, y, 0, 0, True);//click furnace Wait(900 + Random(800)); ClickWindMouse(259, 428, 5, 5, True);//click melt cannonballs Wait(123 + Random(90)); MoveMouseRandom; Wait(1000 + Random(5000)); MoveMouseRandom; Wait(500 + Random(12000)); MoveMouseRandom; Wait(90 + Random(120)); MoveMouseRandom; Wait(150000 + Random(3555));//Long wait for smelting MoveMouseRandom; Wait(1000 + Random(1300)); end; end; procedure Walk2Bank; begin Writeln('Walking to Bank...'); //ClickWindMouse(AAA, AAA, 2, 2, True); //Wait(999999999999 + Random(1500)); //ClickWindMouse(AAA, AAA, 1, 1, True); //Wait(AAAA + Random(AAAA)); end; procedure Cycle; begin StartUp; Walk2Furnace; UseFurnace; Walk2Bank; OpenBank; end; begin repeat Cycle; until(false) end. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 1, 2011 Share Posted December 1, 2011 (edited) Uh, this is gonna take a while. Let me get back to you. Alternately you could just copy the code out of the OpenFurnace routine (with proper credit of course), but I highly recommend you spend some time getting used to OSI. That is its entire reason for being: To make writing scripts easier for you. Protip: Use the CODE tags around your code in a post (button looks like a #) rather than enclosing in quotes. Your code goes here Edited December 1, 2011 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 1, 2011 Author Share Posted December 1, 2011 alright i can wait. and thanks alot:) Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 1, 2011 Share Posted December 1, 2011 OMG my eyes! One word for you: Indenting. I have made the bare minimum changes to make this using OSI. It does not even come close to using OSI to its full potential. This script has other issues anyway. Note that using this script will get you banned. One of the things they check for is doing the exact same mouse clicks over and over with no variation. //////////////////////////////////////////////////////////////////// //CREATED BY: Bryce Raney // x = start here x //Start West Fally Bank (far right 1) [ ][][][][] //////////////////////////////////////////////////////////////////// program FallyCannonBalls; {$DEFINE RS2} {$DEFINE OSI_Color_Anti_Randoms} //{$DEFINE SMART} // Comment out to disable SMART {$I OSI\OSI.scar} {$I OSI\RS2\Skill\Smithing.Scar} procedure LogMeOut; begin Logout; end; procedure MoveMouseRandom; var x, y: Integer; begin x := Random(400); Wait(250 + Random(150)); y := Random(300); Wait(50); MoveWindMouse(x, y, 25, 25); Wait(450 + Random(350)); end; procedure Startup; begin // Set compass to north & camera to highest angle. ClickCompass(True); end; procedure Walk2Furnace; begin Writeln('Walking to Furnace...'); ClickWindMouse(653, 41, 2, 2, True); Wait(5300 + Random(1000)); ClickWindMouse(688, 91, 2, 2, True); Wait(6000 + Random(1350)); ClickWindMouse(670, 121, 1, 1, True); Wait(5000 + Random(1835)); // ClickWindMouse(AAA, AAA, 2, 2, True); // Wait(AAAA + Random(AAAA)); Writeln('At Furnace.'); end; procedure UseFurnace; var B: TBox; begin // Use item slot 2 on furnace. B := GetItemBounds(1); MouseBox(B.X1, B.Y1, B.X2, B.Y2, ClickLeft); if OpenFurnace(Furnace_Falador, ClickLeft) then begin Wait(900 + Random(800)); ClickWindMouse(259, 428, 5, 5, True);//click melt cannonballs Wait(123 + Random(90)); MoveMouseRandom; Wait(1000 + Random(5000)); MoveMouseRandom; Wait(500 + Random(12000)); MoveMouseRandom; Wait(90 + Random(120)); MoveMouseRandom; Wait(150000 + Random(3555));//Long wait for smelting MoveMouseRandom; Wait(1000 + Random(1300)); end; end; procedure Walk2Bank; begin Writeln('Walking to Bank...'); // ClickWindMouse(AAA, AAA, 2, 2, True); // Wait(999999999999 + Random(1500)); // ClickWindMouse(AAA, AAA, 1, 1, True); // Wait(AAAA + Random(AAAA)); end; procedure OpenBank; var w, h: Integer; x, y: Integer; begin if FindColor(w, h, 5991547, MSX1, MSY1, MSX2, MSY2) then begin WriteLn('--- FOUND BANK COLOR ---');//bank color = 5140363 MoveWindMouse(x, y, 1, 1); Wait(25 + Random(50)); ClickWindMouse(x, y, 1, 1, False); Wait(80 + Random(100)); ClickWindMouse(x, y+44, 1, 1, True); Wait(9999999 + Random(9000)); end; end; procedure Cycle; begin StartUp; Walk2Furnace; UseFurnace; Walk2Bank; OpenBank; end; procedure ScriptTerminate; begin FreeOSI; end; begin ClearDebug; SetUpOSI; repeat Cycle; until False; end. [ATTACH]103[/ATTACH] Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 1, 2011 Author Share Posted December 1, 2011 thank you soo much. i just wish i knew how to code OSI to its full potental and make the script so its way more random and not bannable Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 1, 2011 Share Posted December 1, 2011 thank you soo much. i just wish i knew how to code OSI to its full potental and make the script so its way more random and not bannable It just takes the effort to learn, then it's easy. We all started like this somewhere another and then learned. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 1, 2011 Share Posted December 1, 2011 It's a learning process. I'm still learning. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 1, 2011 Share Posted December 1, 2011 Yep. To briefly answer the question the thread title suggests Use ACA with CTS2 etc to get more accurate color readings Use TPA/ATPA sorting with looping Then you can make color finding seriously useful. Quote Link to comment Share on other sites More sharing options...