sleep Posted December 6, 2012 Share Posted December 6, 2012 I am new to this and this is my first attempt at something real. The particular section of my code that is throwing errors follows. [scar] {.includes OSI\OSI.scar} var x, y: Integer; Begin Repeat If FindColors(x, y, 262915, 40, 60, 505, 225) then begin Mouse(x, y, 0, 0, True); Wait(2500); Until(FindColor(x, y, 16776960, 4, 1, 171, 13) = True); Mouse(49, 9, 0, 0, True); Wait(5000); If FindColor(x, y, 999586, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); Wait(300); Else Writeln('Not Found C'); Mouse(445, 25, 0, 0, True); Wait(200); Mouse(328, 17, 0, 0, False); Wait(200); Mouse(328, 285, 0, 0, True); end; If FindColor(x, y, 1398488, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); wait(300); end; If FindColor(x, y, 7697797, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); Wait(300); Else Writeln('Not Found T'); Mouse(445, 25, 0, 0, True); Wait(200); Mouse(328, 17, 0, 0, False); Wait(200); Mouse(328, 285, 0, 0, True); end; end; end. [/scar] Basically what I am wanting this part to do is: Find color Click color Wait Until Color Appears (x,y) Find color click color click coordinate Find color click color click coordinate Find color click color click coordinate click coordinate I would appreciate any helpful response, does this look appropriate? Is it messy? What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 6, 2012 Share Posted December 6, 2012 Well, there was at least plenty of logical/syntax errors.. But I cannot exactly tell what you are trying to do. Anyways, your code should look something like this instead (this compiles): {.include OSI\OSI.scar} var x, y: Integer; begin repeat If FindColor(x, y, 262915, 40, 60, 505, 225) then begin Mouse(x, y, 0, 0, True); Wait(2500); Mouse(49, 9, 0, 0, True); Wait(5000); if FindColor(x, y, 999586, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); Wait(300); end else begin Writeln('Not Found C'); Mouse(445, 25, 0, 0, True); Wait(200); Mouse(328, 17, 0, 0, False); Wait(200); Mouse(328, 285, 0, 0, True); end; if FindColor(x, y, 1398488, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); Wait(300); end; if FindColor(x, y, 7697797, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); Wait(300); end else begin WriteLn('Not Found T'); Mouse(445, 25, 0, 0, True); Wait(200); Mouse(328, 17, 0, 0, False); Wait(200); Mouse(328, 285, 0, 0, True); end; end; until FindColor(x, y, 16776960, 4, 1, 171, 13); end. Although, you might be after more loops than just that 1. Meaning loops inside that loop. Not sure. -Jani Quote Link to comment Share on other sites More sharing options...
sleep Posted December 6, 2012 Author Share Posted December 6, 2012 Thanks for helping me see the problems I had! I realized that I was trying to do too much with this. I have since separated it out into two pieces. [scar] begin repeat If FindColor(x, y, 789259, 80, 25, 491, 150) then begin Mouse(x, y, 0, 0, True); Wait(5000); end; until (FindColor(x, y, 16776960, 4, 1, 171, 13) = True); Mouse(49, 9, 0, 0, True); Wait(1250); end; [/scar] and [scar] Begin If FindColor(x, y, 999586, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 245, 0, 0, True); Wait(1000); end; begin Mouse(425, 215, 0, 0, True); Wait(300); Mouse(425, 270, 0, 0, True); wait(1000); end; If FindColor(x, y, 7697797, 60, 30, 450, 230) then begin Mouse(x, y, 0, 0, True); Wait(300); Mouse(425, 245, 0, 0, True); Wait(1000); end; end; [/scar] (Note, in this second set of code I use an exact coordinate because I couldn't find my smelted bars and kept coming across my ores.) This seems to have worked out very well but the biggest problem is going to a specific location using the minimap in PRSC. Any ideas on getting from the bank in al kharid to the furnace? Thanks again Jani! Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 6, 2012 Share Posted December 6, 2012 This seems to have worked out very well but the biggest problem is going to a specific location using the minimap in PRSC. Any ideas on getting from the bank in al kharid to the furnace? Nope sorry mate, I can't help you with that..The thing is, reliable(!) minimap walking is just 1 of those things that I haven't figured out yet. I know that there has been some ancient scripts using minimap walking, but I am not aware of the methods or how reliable the walking was. ..but also, those ancient methods could have been working with perfect north. The distance that you are using is not really all that hard to beat though (comparing to longer paths, like walking from Varrock to Falador), because I think you can already see the furnace from bank? IIRC. -Jani Quote Link to comment Share on other sites More sharing options...
Incommodious Posted December 7, 2012 Share Posted December 7, 2012 I've found recently that using FindBitmap works a little better than FindColor if trying to find something bigger and more specific Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 7, 2012 Share Posted December 7, 2012 Are you working with a private server, RSC, or the official RS2 game? If using RS2 why not use the ore/bar dtms included in OSI's Smithing.scar? I can personally attest to the fact that they work. (except when using smart but I think that is just my wonky machine) Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 7, 2012 Share Posted December 7, 2012 Bixby, hes writing scripts to Project RSC - RuneScape Classic private server. -Jani Quote Link to comment Share on other sites More sharing options...
sleep Posted December 7, 2012 Author Share Posted December 7, 2012 I did get it working for furnace to bank, but not super reliably. IIRC everyone used to use minimap images for walking. With the super short distance what I did was find a pixel coordinate that clicked inside the bank from the minimap at all extremes of minimap rotation. This works, but was a bit annoying and it WILL mess up eventually which I suppose is better than nothing, especially considering I haven't come across an ocr/sleeper. Quote Link to comment Share on other sites More sharing options...