I'm attempting a flax picker as my first script, but I can't get it to walk to the flax field. I tried DTM's and Bitmaps but whenever I do it doesn't find either. So in this one, it's lookin' for the woodcutting bitmap in the lower part of the minimap, always returns that it can't find it.. Any help would be extremely grateful.
Also, the script is NOWHERE near finished.. So don't bother me about that...
Code:{.Script Info: # ScriptName = Basic Flax Picker # Author = Vagrant # Description = Picks flax and banks it. # Version = BETA # Date = # Comments = /Script Info} program BasicFlaxPicker; {.include SRL/SRL.scar} const Bank=99; //Amount of times you'd like to bank var Clicks,Banked,WcIcon: Integer; procedure AntiRandoms; begin FindTalk; FindNormalRandoms; if (FindFight = true) then begin RunAwayDirection('N'); Wait(10000+random(2000)); RunBack; end end; procedure WalkToFlax; begin repeat If FindBitmap(WcIcon,x,y)Then begin Mouse(x-10,y-10,2,2,true) Wait(5000+random(5000)); end else Writeln('Could not find WcIcon, Trying again...'); until(FindBitmapToleranceIn(WcIcon,x,y,541,89,739,164,10)); FreeBitmap(WcIcon); end; procedure PickFlax; begin if (IsUpText('lax')) then begin GetMousePos(x, y); Mouse(x, y, 3, 3, true); repeat AntiRandoms; until (not (FlagPresent)) and (not (InvCount = 0)); end if (FindObj3(x,y,'Pick Flax',15065494,15)) then begin Mouse(x, y, 1, 1, true); repeat AntiRandoms; until (not (FlagPresent)) and (not (InvCount = 0)); end Clicks:=Clicks + 1; end; procedure ProgressReport; begin Cleardebug; Writeln('=======Progress Report======='); Writeln(TimeRunning); Writeln('Clicked ' +IntToStr(Clicks)+ ' Time[s]'); Writeln('Banked ' +IntToStr(Banked)+ ' Time[s]'); Writeln('============================='); end; begin SetUpSRL; Cleardebug; Clicks:=0; Banked:=0; WcIcon := BitmapFromString(15, 15, 'z78DAADD4510E80200800D0' + '2B6153CBCF5875FF2395D91A2E409CD1E687C513590AA086539FD' + 'E20B918316092C68E55040D5CD8F39B19EB9159C56082F3F72C6F' + '8AFEAF728A29244E6E98AABC2E3B78B13323B2D099966CE806A99' + '976A647B6765B97BF7EF97E3A1CC29BCB9BCC1F28F834EBDAF601' + '95D03055998EB4E6C6A9B49FC12DCF17B954DE611AEE0DBAF7A7D' + 'B233170D79DF8DA170B'); repeat PerfectNorth; MakeCompass('N'); GameTab(4); WalkToFlax; repeat PickFlax; until(InventoryFull) //WalkToBank ProgressReport; until(Banked=Bank); end.


Reply With Quote
GL
