Results 1 to 4 of 4

Thread: whats wrong with this script

  1. #1
    Join Date
    Jul 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default whats wrong with this script

    im wondering what wrong with this script and how do i make it work?

    {.Script Info:
    # ScriptName = Tree Chopper + Firemaker
    # Author = madman
    # Description = Chops trees until full inventory then makes fires
    # Version = v0.3
    # Date = 3-Feb-2006
    # Comments = Start anywhere where there are trees, with an axe and tinderbox.
    # Autocolor = Yes

    # Release Comments
    * 0.1 - Inital Release
    * 0.2 - Added AntiBan
    * 0.3 - Improved AntiRandoms. Made script walkback after moving to make a fire

    # Credits
    * DWW + Charmz - Various Procedures

    **PLEASE post comments and suggestion in post**
    - http://villu-reborn.com/showthread.php?t=6459 -
    /Script Info}
    program ChopperFireMaker;
    {.include SRL\SRL.SCAR}
    {.include SRL\SRL\skill\WoodCutting.scar}

    Var
    Colors: Array[1..3] of Integer;
    Loads, LogCount : Integer;
    LogDTM, TinderDTM : Integer;
    WalkCount, TempCount : Integer;
    SST1, SST2 : LongInt;
    FindNorMalRandomsTime, FindFastRandomsTime : LongInt;

    Const
    TreeTol = 5; //Tolerance for tree color
    WaitTime = 10; //Maximum time before clicking tree again (seconds)
    MaxLoads = 10; //Max Loads Per Player
    MinutesALoad = 5; //Maximum minutes per load
    LeftCPercent = 80; //Percent to left click
    Version = '0.3'; //No Touch This


    Procedure DeclarePlayers;
    Begin
    StartPlayers(true, '');
    End;


    //*************************\\
    // DTMS / BMPS \\
    //*************************\\

    Procedure LoadDTM;
    Begin
    LogDTM := DTMFromString('78DA63F466626078CA8002B2820C19FE036 94' +
    '620FE0F048C7640357719D000231209A42D816A5E1150E302 54F3' +
    '91809A50A09A3704D40401D53C2242CD6D026A3C816AEEE05 7030' +
    '0D68B0F7A');
    TinderDTM := DTMFromString('78DA63F4626260E060644006098E9C0CFF8 13' +
    '448F43F10308601D570A1AA81C8C248200D32478C801A6BA0 1A3E' +
    '026ADC806AFE31E057130254F397801A27A01A6102760511E 11E7' +
    'BA01A16026A7C816AFEE0770F00952B0C0F');
    End;

    //****************\\
    // ANTIBAN \\
    //****************\\
    Procedure MyAntiBan;
    Begin
    RandomChatEvery(10 + Random(5));
    RotateEvery(5 + Random(2));
    LeaveScreenEvery(5 + Random(5));
    PickUpMouseEvery(5 + Random(10))
    RandomRClickEvery(15 + Random(5))
    End;

    //*****************\\
    // RANDOMS \\
    //*****************\\
    Function TreeColor : Integer; Forward;

    Function FindFastRandoms: Boolean;
    var
    i: Integer;
    begin
    for i:=1 to 8 do
    begin
    case I of
    1: If FindDead then
    Result := True;
    2: If FindMod then
    Result := True;
    3: If FindMime then
    Result := True;
    4: If FindMaze then
    Result := True;
    5: If FindQuiz then
    Result := True;
    6: If FindDemon then
    Result := True;
    7: begin
    if NoGameTab then
    begin
    Result := True;
    Players[CurrentPlayer].loc := 'No GameTab';
    Logout;
    Exit;
    end;
    end;
    7: begin
    if InBlack then
    begin
    Result := True;
    Players[CurrentPlayer].loc := 'InBlack';
    Logout;
    Exit;
    end;
    end;
    8: RC;
    end;
    wait(1);
    end;
    end;

    Procedure FTWaitK(Time:Integer);
    var
    t: integer;
    begin
    For T:=1 to Time do
    begin
    Wait(200+Random(50));
    FindTalk;
    end;

    FindHead;
    FindEnt(TreeColor);
    FindBirdsNest;

    if(FindFight)then
    Begin
    RunAwayDirection('N');
    FTWaitK(4 + random(3));
    RunBack;
    End

    FindFastRandoms;
    MarkTime(FindNorMalRandomsTime);
    if FindNorMalRandomsTime-SST1 >(10000+Random(5000)) then
    begin
    Status('FindNorMalRandoms.');
    FindNorMalRandoms;
    FindTalk;
    MarkTime(SST1);
    Status('FindNorMalRandoms took:'+IntToStr(SST1-FindNorMalRandomsTime)+' msec');
    end;

    MarkTime(FindFastRandomsTime);
    if FindFastRandomsTime-SST2 >(1500+Random(1500)) then
    begin
    Status('FindFastRandoms.');
    FindFastRandoms;
    FindTalk;
    MarkTime(SST2);
    Status('FindFastRandoms took:'+IntToStr(SST2-FindFastRandomsTime)+' msec');
    end;
    end;

    Function Ent(Ex,Ey : integer): Boolean; //From Charmz
    Begin
    MMouse(Ex, Ey, 0, 0);
    If(FindColorSpiralTolerance(x, y, 3432536, MSX1, MSY1, MSX2, MSY2, 10))then
    MMouse(x, y, 0, 0);
    If(IsUpText('Chop')) or (IsUpText('Tree')) or (IsUpText('Down'))then
    Begin
    If(FindColorSpiralTolerance(x, y, 383705, 1, 1, 180, 39, 20))or
    (FindColorSpiralTolerance(x, y, 65535, 1, 1, 200, 40, 20))then
    Begin
    Result:= True;
    EntsAvoided:=EntsAvoided + 1;
    WriteLn('Ent found, waiting');
    Mouse(648, 83, 1, 1, True);
    // Wait(5000+Random(2000));
    FTWaitK(22);
    End else
    Result:= False;
    Exit;
    End;
    End;

    //******************\\
    // COLOR STUFF \\
    //******************\\

    Function FindTreeColorsIfNeeded(refrencecol,tol,tol2:intege r):boolean; //Stole from DWW
    Var
    c,a,b,xm,ym,curcolor:integer;
    oc1,oc2,oc3:boolean;

    Begin
    If ((Colors[1]=0) or (Colors[2]=0) or (Colors[3]=0)) Then
    Begin
    If (FindColorTolerance(x,y,refrencecol,3,3,515,338,to l)) Then//Find tree close
    Begin
    if (FindObj(x,y,'Chop',refrencecol,tol)) Then
    Begin
    a:=1;
    GetMousePos(x,y);
    xm:=x;
    ym:=y;
    repeat
    xm:=xm+a;
    ym:=ym+b;
    curcolor:=GetColor(xm,ym);
    MMouse(xm,ym, 5, 5);
    Wait(5+random(5));
    If(IsUpText('Chop'))then
    Begin
    If(SimilarColors(curcolor,refrencecol,tol2))and(oc 1=false)then
    Begin
    Colors[1]:=curcolor;
    oc1:=true;
    End;
    If(SimilarColors(curcolor,refrencecol,tol2))and
    (not(curcolor=Colors[1]))and(oc2=false)then
    Begin
    Colors[2]:=curcolor;
    oc2:=true;
    End;
    if(SimilarColors(curcolor,refrencecol,tol2))and
    (not(curcolor=Colors[1]))and
    (not(curcolor=Colors[2]))and(oc3=false)then
    Begin
    Colors[3]:=curcolor;
    oc3:=true;
    End;
    End;
    If(not(IsUpText('Chop')))then
    Begin
    c:=c+1;
    xm:=x;
    ym:=y
    MMouse(xm,ym,1,1);
    // wait(200+random(100)+random(100))
    FTWaitK(2);
    if(c=1)then a:=-1;
    if(c=2)then begin a:=0;b:=-1;end;
    if(c=3)then begin a:=0;b:=2;end;
    End;
    Until((oc1)and(oc2)and(oc3))or(c>=4);
    End;
    End;
    If(Colors[1]>0)and(Colors[2]>0)and(Colors[3]>0)then result:=true;
    End;
    End;

    Function TreeColor : integer; //Stolen from DWW
    Var RandomColor:integer;
    Begin
    Repeat
    RandomColor:=random(3)+1;
    Until (RandomColor >= 1) or (RandomColor <= 3);
    Result:=Colors[RandomColor];
    End;

    //*******************\\
    // PROCEDURES \\
    // + \\
    // FUNCTIONS \\
    //*******************\\

    Procedure ProgressReport;
    Begin
    ClearDebug;
    Writeln('****************************');
    Writeln('/ Fire Maker + Log Chopper \');
    Writeln('/ v' + Version + ' \');
    Writeln('============================');
    Writeln(' Ran for ' + TimeRunning);
    Writeln(' Cut and light ' + IntToStr(LogCount) + ' logs');
    Writeln('****************************');
    End;

    Function FindTree(MaxTol:Integer):Boolean; //Stolen from DWW
    Var Tol,Ex,Ey:Integer;

    Begin
    While (Not (FindColorTolerance(Ex, Ey, TreeColor, MSX1, MSY1, MSX2, MSY2, Tol))
    And Not (Tol > MaxTol)) Do
    Begin
    Tol:=Tol+1;
    End;
    If ((FindColorTolerance(Ex, Ey, TreeColor, MSX1,MSY1 ,MSX2, MSY2, Tol))
    And Not (Tol > MaxTol)) Then Result:=True;
    Tol:=1;
    Wait(10);
    End;

    Procedure DoChopping;
    Begin
    if(FindTree(TreeColor))then
    Begin
    if(FindObj(x, y, 'ree', TreeColor, TreeTol))then
    Begin
    if(not(Ent(x, y)))then
    Begin
    if((Random(100) + 1) < LeftCPercent)then
    Begin
    Mouse(x, y, 0, 0, true);
    Wait(50);
    End else
    Begin
    Mouse(x, y, 0, 0, false);
    ChooseOption(x, y, 'own');
    Wait(50);
    End
    Flag;
    //Wait(500 + Random(500));
    FTWaitK(2);
    MarkTime(Mark);
    repeat
    //DoMyRandoms;
    //Wait(50 + random(50));
    FTWaitK(1);
    if(InvFull)then Break;
    Until(not(TimeFromMark(Mark) > (1000 * WaitTime)));
    End
    End
    End
    End;

    //*****************\\
    // MAIN LOOP \\
    //*****************\\
    Procedure NewPlayer;
    Begin
    LoginPlayer;
    GameTab(4);
    if(not(FindInvDTM(x, y, TinderDTM)))then
    Begin
    Writeln('No tinder box! ... NextPlayer');
    NextPlayer(false);
    End
    HighestAngle;
    SetRun(true);
    PerfectNorth;
    End;

    Procedure Setup;
    Begin
    SetupSRL;
    LoadDTM;
    MouseSpeed := 5 + Random(5);
    BenMouse := true;
    DeclarePlayers;
    ActivateClient;
    Wait(1000 + Random(1000));
    End;

    begin
    Setup;
    Repeat
    NewPlayer;
    FindAxeHeadColor;
    FindTreeColorsIfNeeded(1520688, 5, 45);
    Repeat
    MarkTime(Mark);
    Repeat
    if(not(LoggedIn))then Break;
    if(InvFull)then Break;
    DoChopping;
    Until((InvFull) or (TimeFromMark(Mark) >= 1000 * 60 * MinutesALoad));
    WalkCount := 0;
    Repeat
    if(FindInvDTM(x, y, LogDTM))then
    begin
    Mouse(x, y, 3, 3, true);
    //Wait(1000 + random(500));
    FTWait(4);
    if(FindInvDTM(x, y, TinderDTM))then
    begin
    Mouse(x, y, 3, 3, true);
    //Wait(1000 + Random(500));
    FTWait(4);
    repeat
    if(InChatMulti('ou can', 't ligh', 't a fir'))then
    Begin
    MouseFindFlag(MMCX, MMCY, 15, -15);
    WalkCount := WalkCount + 1;
    Flag;
    Break;
    End
    //Wait(500);
    FTWaitK(2);
    until(not(InChat('attempt to'))) or (InChat('advanced a'));
    End
    LogCount := LogCount + 1;
    End
    Until(not(FindInvDTM(x, y, LogDTM)));
    Loads := Loads + 1;
    TempCount := 0;
    repeat
    MouseFindFlag(MMCX, MMCY, -15, 15);
    TempCount := TempCount + 1;
    Flag;
    Until(TempCount >= WalkCount);
    ProgressReport;
    SRLRandomsReport;
    if(Loads >= MaxLoads)then
    Begin
    Logout;
    Break;
    End
    Until(not(LoggedIn));
    NextPlayer(true);
    Until(false);
    end.

  2. #2
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Date = 3-Feb-2006

    *Cough*
    Hope that explains look for an other script.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  3. #3
    Join Date
    Jul 2007
    Location
    America
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Could you at least tell us what errors it gives you, or what the thing that's wrong is? (it messes up walking, can't drop, etc). Also, please put future scripts in the scar brackets. It makes it much easier to read.
    I dunno, those asians are pretty difficult to out-auto, legend has it they don't need sleep or food...~tim0suprem0
    Activity is on the decline - school's got me
    Check out my tutorial[s] on Color Finding!||Procedures and Functions!

  4. #4
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Feb 2006... thats date this VBulletin Board was open XD I recommend a better one

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. whats wrong with my script !?!?!?!!?
    By stampede10343 in forum OSR Help
    Replies: 7
    Last Post: 02-25-2008, 02:37 AM
  2. Script, whats wrong
    By Camaro' in forum OSR Help
    Replies: 10
    Last Post: 06-01-2007, 01:15 AM
  3. Whats wrong in my script?
    By Intef i i i in forum OSR Help
    Replies: 2
    Last Post: 04-10-2007, 03:29 PM
  4. whats wrong with this script?
    By fugate in forum OSR Help
    Replies: 14
    Last Post: 01-16-2007, 04:44 AM
  5. Replies: 7
    Last Post: 11-26-2006, 03:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •