Results 1 to 19 of 19

Thread: Won't work, can't figure out why! ;((

  1. #1
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Won't work, can't figure out why! ;((

    I can't get this work

    SCAR Code:
    Procedure AttackChicken;
    begin
    Wait(750+random(250));
    MouseCoordX := 250;
    MouseCoordY := 150;
    Wait(100+random(50));
    Gametab(4);
    Wait(100+random(50));
    repeat
    if (FindColorTolerance(MouseCoordX, MouseCoordY, 858754, 5, 5, 500, 300, Tolerance))or
       (FindColorTolerance(MouseCoordX, MouseCoordY, 1517505, 5, 5, 500, 300, Tolerance))then
       begin
          Wait(10+random(5))
          if (FindColorTolerance(MouseCoordX, MouseCoordY, 1326673, MouseCoordX-15, MouseCoordY+15, MouseCoordX+15, MouseCoordY-15, Tolerance))or
             (FindColorTolerance(MouseCoordX, MouseCoordY, 2836574, MouseCoordX-15, MouseCoordY+15, MouseCoordX+15, MouseCoordY-15, Tolerance))or
             (FindColorTolerance(MouseCoordX, MouseCoordY, 5798019, MouseCoordX-15, MouseCoordY+15, MouseCoordX+15, MouseCoordY-15, Tolerance))or
             (FindColorTolerance(MouseCoordX, MouseCoordY, 8893894, MouseCoordX-15, MouseCoordY+15, MouseCoordX+15, MouseCoordY-15, Tolerance))then
             begin
                Wait(5+random(4))
                MMouse(MouseCoordX, MouseCoordY, 4, 4)
                Wait(25+random(10))
                if (IsUpText('ick'))then
                   begin
                      Wait(10+random(10))
                      Mouse(MouseCoordX, MouseCoordY, 4, 4, true)
                      Wait(TimeToKillChicken+random(250))
                   end
             end
       end;
    Tolerance:=Tolerance+3;
    until(Tolerance>30);
    end;

    Error: something about canvas and draving

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    whats the problem? Is it not compiling?

    And why would it be something about canvas or drawing?

  3. #3
    Join Date
    Oct 2006
    Posts
    161
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think he means when running the script, it gets the error i get sometimes when trying to change around a script about not being able to draw on canvas., whatever the autoer is doing
    when script stops running, thats where the problem is.

  4. #4
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You had SetUpSRL; in your script?
    I'm not sure if thats the problem.
    But if you don't have SetUpSRL; it will give errors in SRL's text finding function, like in IsUpText.

  5. #5
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, SetUpSRL is included in the first line of the mainloop

    Here's the actual error :
    [Runtime Error] : Exception: Canvas does not allow drawing in line 99 in script F:\Omat Kansiot 3\SCAR\Scripts\MagicalChickenKiller.scar
    But no prob ATM cuz I'm going to use 1 style created by Rune Hacker (atleast test it)

  6. #6
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by PwNZoRNooB View Post
    Yes, SetUpSRL is included in the first line of the mainloop

    Here's the actual error :

    But no prob ATM cuz I'm going to use 1 style created by Rune Hacker (atleast test it)
    Voitsä näyttää koko scriptin?

  7. #7
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Hyväksytäänkö täällä eri kielillä puhuminen :O?

    Jaajaa huomasin just itekki ton "Omat Kansiot"

  8. #8
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by GoF View Post
    Hyväksytäänkö täällä eri kielillä puhuminen :O?

    Jaajaa huomasin just itekki ton "Omat Kansiot"
    Haha! (Ei oo kukaa kieltänykkää)

  9. #9
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hyvä, ni tota täs on koko scripti, tosin täysin kesken! en oo jaksanu tehä anti-randomeita enkä anti-banniakaa viel, staffin kattominen ja spellin valkkaus on tehty ja on aika stabiili.

    SCAR Code:
    program MagicalChickenKiller;

    {.include SRL/SRL.scar}

    var
       MouseCoordX, MouseCoordY : Integer;
       
    var
       Tolerance : Integer;

    const
         SpellNumber = 1; //1-4 Strikes Wind, Water, Earth & Fire
         TimeToKillChicken = 10000;
         
    Procedure CheckStaff;
    begin
    MouseCoordX := 586;
    MouseCoordY := 290;
    Wait(50+random(5));
    Gametab(5);
    Wait(100+random(50));
    MMouse (MouseCoordX, MouseCoordY, 10, 10);
    Wait(350+random(150));
    if (IsUpText('aff')) then
       Writeln('Staff Found')
    else
       Writeln('No Staff Found')
    end;

    Procedure TakeSpell;
    begin
    Wait(750+random(75));
    Gametab(1);
    Wait(150+random(50));
    Mouse(663, 320, 15, 10, true);
    Wait(500+random(150));
    if (SpellNumber = 1) then
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 12632764, 580, 220, 597, 234))then
                  begin
                     Wait(250+random(50))
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Wait(50+random(10))
                     Writeln('Windstrike Activated')
                     Exit
                  end
       Writeln('Windstrike NOT Found');
       end;
    if (SpellNumber = 2) then
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 16349818, 618, 220, 640, 234))then
                  begin
                     Wait(250+random(50))
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Wait(50+random(10))
                     Writeln('Waterstrike Activated')
                     Exit
                  end
       Writeln('Waterstrike NOT Found');
       end;
    if (SpellNumber = 3) then
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 307460, 660, 220, 677, 234))then
                  begin
                     Wait(250+random(50))
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Wait(50+random(10))
                     Writeln('Earthstrike Activated')
                     Exit
                  end
       Writeln('Earthstrike NOT Found');
       end;
    if (SpellNumber = 4) then
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 168440, 696, 220, 719, 234))then
                  begin
                     Wait(250+random(50))
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Wait(50+random(10))
                     Writeln('Firestrike Activated')
                     Exit
                  end
       Writeln('Firestrike NOT Found');
       end;
    end;

    Procedure AttackChicken;
    begin
    Wait(750+random(250));
    MouseCoordX := 250;
    MouseCoordY := 150;
    Wait(100+random(50));
    Gametab(4);
    Wait(100+random(50));
    repeat
    if (FindColorTolerance(MouseCoordX, MouseCoordY, 1055887, 5, 5, 500, 300, Tolerance))then
       begin
          Wait(10+random(5))
          if (FindColorTolerance(MouseCoordX, MouseCoordY, 3364465, MouseCoordX-15, MouseCoordY+15, MouseCoordX+15, MouseCoordY-15, Tolerance))then
             begin
                Wait(5+random(4))
                MMouse(MouseCoordX, MouseCoordY, 4, 4)
                Wait(25+random(10))
                if (IsUpText('ick'))then
                   begin
                      Wait(10+random(10))
                      Mouse(MouseCoordX, MouseCoordY, 4, 4, true)
                      Wait(TimeToKillChicken+random(250))
                   end
             end
       end;
    Tolerance:=Tolerance+3;
    until(Tolerance>30);
    end;

    begin
    SetUpSRL;

    ActivateClient;

    CheckStaff;

    TakeSpell;

    AttackChicken;
    end.

    Älkää ihmetelkö tota spellien valintaa, en oo jaksanu opiskella casee viel

    Mutta toi kanan löytäminen on nyt duunissa, kokeilen tällästä Rune Hackerin juttuu eka (Crediteillä totta kai!)
    SCAR Code:
    Procedure Killchicken;
    begin
    if(FindColorSpiral(MCX,MCY, RedColor, MSX1,MSY1,MSX2,MSY2))or
      (FindColorSpiral(MCX, MCY, BrownColor, MSX1-10, Msy1+10, MSX2+10, MCY2-10))then
      begin
        MMouse(MCX, MCY, 3, 3);
        Wait(20+random(10));
      end;
      if(IsUpText('cken'))then
      begin
        Wait(5+random(10));
        Mouse(MCX, MCY, 2, 2, true)
        Wait(TimeToWaitChicken+random(100));
      end;
    end;

    Mut oon auki ehdotuksille, tää on ollu piikki persuksissa vähän aikaa et miten tekis ton


    EDIT: Btw mul on C:llä oikee Omat Kansiot, D:llä on Omat Kansiot 2 ja F:llä on myös Omat Kansiot

  10. #10
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Laitas linja 99 kohalle tää:
    SCAR Code:
    if (FindColorTolerance(MouseCoordX, MouseCoordY, 3364465, MouseCoordX-15, MouseCoordY-15, MouseCoordX+15, MouseCoordY+15, Tolerance))then
    Ei pitäis antaa enää virhe ilmotuksii.

    Ja caset:
    SCAR Code:
    Procedure TakeSpell;
    begin
    Wait(750+random(75));
    Gametab(1);
    Wait(150+random(50));
    Mouse(663, 320, 15, 10, true);
    Wait(500+random(150));

    Case SpellNumber of
     1:
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 12632764, 580, 220, 597, 234))then
                  begin
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Writeln('Windstrike Activated')
                  end
                 else
       Writeln('Windstrike NOT Found');
       end;
     2:
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 16349818, 618, 220, 640, 234))then
                  begin
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Writeln('Waterstrike Activated')
                  end
                 else
       Writeln('Waterstrike NOT Found');
       end;
     3:
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 307460, 660, 220, 677, 234))then
                  begin
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Writeln('Earthstrike Activated')
                  end
                 else
       Writeln('Earthstrike NOT Found');
       end;
     4:
       begin
                  if (FindColor(MouseCoordX, MouseCoordY, 168440, 696, 220, 719, 234))then
                  begin
                     Mouse(MouseCoordX, MouseCoordY, 2, 2, true)
                     Writeln('Firestrike Activated')
                  end
                 else
       Writeln('Firestrike NOT Found');
       end;
     end;
    end;

    Ja käytä vaik SRL:n FindObj functionii kohteitten ettimisee.
    oisko täs mitää?
    SCAR Code:
    Procedure Killchicken;
    begin
    if(FindObj(x,y,'ick',RedColor,5))or
    FindObj(x,y,'ick',BrownColor,5))then
     begin
      Mouse(x,y,5,5 true)
      Wait(TimeToWaitChicken+random(100));
     end;
    end;

  11. #11
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Kiitoksia tosi paljon, en ookkaa tienny tommosista FindObj -jutuista ees
    Oon ollu tääl jonku viikon-kaks, yrittäny lueskella tutoja.

    EDIT: Annatko meses ni voin kysellä apua, ei tartte ofc jos et haluu pientä tiedonhimoista kakaraa kyselemään scriptauksesta

  12. #12
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by PwNZoRNooB View Post
    Kiitoksia tosi paljon, en ookkaa tienny tommosista FindObj -jutuista ees
    Oon ollu tääl jonku viikon-kaks, yrittäny lueskella tutoja.

    EDIT: Annatko meses ni voin kysellä apua, ei tartte ofc jos et haluu pientä tiedonhimoista kakaraa kyselemään scriptauksesta
    Voitha sä lisätä mut mesee, klikkaa tota mesen(perhosen) kuvaa mun nimen iha oikees reunas ni näät ossan.
    En saata kyl käyä siel kovi paljo, mut sillo tällö...

  13. #13
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Omg whats happening? Are you guys talking strange or is my pc going kookoo

  14. #14
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  15. #15
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Soumi?

  16. #16
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Suomi* and we're talking Suomea

    Muute teinki täst Wiz Tower Demon Tappajan nyt toi hyökkäys onki näin

    SCAR Code:
    Function KillingDemon : Boolean;
    begin
    Wait(150+random(50));
    if(FindColorTolerance(MouseCoordX, MouseCoordY, 1979517, 80, 154, 402, 326, 3))then
      begin
         Wait(50+random(10))
         Mouse(MouseCoordX, MouseCoordY, 3, 3, false)
         ChooseOption(MouseCoordX, MouseCoordY, 'ttac')
         result := true;
         Wait(TimetoKillDemon+random(200))                      // ANTI-RANDOMS & ANTI-BAN HERE
       end;
    end;

    Toi klikkaa sen päästä, teen myös 2 muuta ja laitan randomin et mistä se klikkaa

    EDIT: Toimii hyvin ku siel toweris ei oo mitää muuta punast oikee.

  17. #17
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by PwNZoRNooB View Post
    Suomi* and we're talking Suomea

    Muute teinki täst Wiz Tower Demon Tappajan nyt toi hyökkäys onki näin

    SCAR Code:
    Function KillingDemon : Boolean;
    begin
    Wait(150+random(50));
    if(FindColorTolerance(MouseCoordX, MouseCoordY, 1979517, 80, 154, 402, 326, 3))then
      begin
         Wait(50+random(10))
         Mouse(MouseCoordX, MouseCoordY, 3, 3, false)
         ChooseOption(MouseCoordX, MouseCoordY, 'ttac')
         result := true;
         Wait(TimetoKillDemon+random(200))                      // ANTI-RANDOMS & ANTI-BAN HERE
       end;
    end;

    Toi klikkaa sen päästä, teen myös 2 muuta ja laitan randomin et mistä se klikkaa

    EDIT: Toimii hyvin ku siel toweris ei oo mitää muuta punast oikee.
    Voisit käyttää x:ää ja y:tä MouseCoordx:n ja MouseCoordy:n sijasta, paljo nopeempaa.

  18. #18
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  19. #19
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    ............If we're not careful we'll have to start scripting in a new language to....>.<
    Sleeping...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can YOU figure it out??
    By Metagen in forum OSR Help
    Replies: 3
    Last Post: 10-07-2008, 06:44 PM
  2. Cant figure out scar
    By runner732 in forum OSR Help
    Replies: 11
    Last Post: 11-29-2007, 01:51 PM
  3. Cant figure out a way to...
    By r3dr4g0n in forum OSR Help
    Replies: 8
    Last Post: 10-02-2007, 06:14 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
  •