Results 1 to 15 of 15

Thread: How to detect text?

  1. #1
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to detect text?

    How do you detect text like, you right click, then click Attack...? Also, if Attack isn't there it clicks cancel or moves the mouse away so the right-clicked box goes away.

  2. #2
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think it would be:

    If (findtext(attack)) then
    clicktext('attack')
    else
    clicktext('cancel')

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

    Default

    Ok, I am just trying to see if it right clicks a monk, then clicks attack, else cancel. Heres what I have:

    Code:
    program Fighter;
    const
    Monster=12172221;
    Betweentime = 3;
    Var x,y:Integer;
    Procedure FindColor;
    begin;
    FindColorSpiral(x,y,Monster,5,5,760,495);
    end;
    Begin FindColor;
    wait((Betweentime * 1000) + random(300))
    If (findtext(attack)) then
    getmousepos(x,y);
    clickmouse(x,y,False);
    clicktext('attack')
    else
    clicktext('cancel')
    end.
    And I get this error:

    Code:
    Line 12: [Error] (12:5): Unknown identifier 'findtext' in script XXXXXXXXXXXXXXX
    What do I change?

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    How bout looking in TEXT.scar??????????????????

    Hint:
    ClickOption
    ChooseOption
    popup

  5. #5
    Join Date
    Nov 2006
    Location
    California, USA
    Posts
    336
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    {.include srl\srl.scar}

    SetupSRL;

    And if this is the case just find use
    IsUpText('Attack Monk');

  6. #6
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program Fighter;
    {.include srl\srl.scar}
    SetupSRL;
    const
    Monster=12172221;
    Betweentime = 3;
    Var x,y:Integer;
    Procedure FindColor;
    begin;
    FindColorSpiral(x,y,Monster,5,5,760,495);
    end;
    Begin FindColor;
    wait((Betweentime * 1000) + random(300))
    If (findtext(attack)) then
    getmousepos(x,y);
    clickmouse(x,y,False);
    clicktext('attack')
    else
    clicktext('cancel')
    end.
    Where do I put IsUpText('Attack Monk');

    (I am newb at SCAR... but not scripting)

  7. #7
    Join Date
    Nov 2006
    Location
    California, USA
    Posts
    336
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program Fighter;
    {.include srl\srl.scar}
    const
    Monster=12172221;
    Betweentime = 3;

    var
    x,y:Integer;

    function FindMonk: Boolean;
    begin;
    if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
      Result:= True;
    else
      Result:= False;
    end;

    Begin
    SetupSRL;
    ActivateClient;
    repeat
      wait((Betweentime * 1000) + random(300));
      if(FindMonk) then
      begin
        if (IsUpText('Attack Monk')) then
          Mouse(x, y, 10, 10, True);
      end;
    until(not(LoggedIn))
    end.

  8. #8
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program Fighter;
    {.include srl\srl.scar} Const
    Monster=12172221;
    Betweentime = 3;
    
    Var x,y:Integer;
    Procedure FindColor;
    function FindMonk: Boolean;
    begin
    if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
     Result:= True;
    else
     Result:= False;
    Begin
    SetupSRL;
    ActivateClient;
    repeat
    Begin FindColor;
    wait((Betweentime * 1000) + random(300)) if(FindMonk) then if (IsUpText('Attack Monk') then
    Mouse(x, y, 10, 10, True);
    until (not(LoggedIn)) end.
    New error:

    Code:
    Line 8: [Error] (8:1): 'BEGIN' expected in script
    TY for help aswell.

  9. #9
    Join Date
    Oct 2006
    Location
    England
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixed.
    PHP Code:
    program Fighter;
    {.include 
    srl\srl.scar}
    Const
      
    Monster=12172221;
      
    Betweentime 3;

    Var 
    x,y:Integer;

    function 
    FindMonkBoolean;
    begin
    if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
     Result
    := True;
    else
     
    Result:= False;
    Begin
    SetupSRL
    ;
    ActivateClient;
    repeat
    Begin FindColor
    ;
    wait((Betweentime 1000) + random(300)) if(FindMonkthen if (IsUpText('Attack Monk'then
    Mouse
    (xy1010True);
    until (not(LoggedIn)) 
    end

  10. #10
    Join Date
    Nov 2006
    Location
    California, USA
    Posts
    336
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Kaldo, here is my version(this time fixed IN SCAR) make sure you delete all of your old one and paste this in exactly(which you failed to do the first time.)

    Code:
    program Fighter;
    {.include srl\srl.scar}
    
    const
    Monster = 12172221;
    Betweentime = 3;
    
    function FindMonk: Boolean;
    begin;
    if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
      Result:= True
    end;
    
    Begin
      SetupSRL;
      ActivateClient;
      repeat
        wait((Betweentime * 1000) + random(300));
        if(FindMonk) then
        begin
          if (IsUpText('Attack Monk')) then
            Mouse(x, y, 10, 10, True);
        end;
      until(not(LoggedIn))
    end.
    arr0w your's is broken to

  11. #11
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry, that won't work either. How is the UpText supposed to show 'Attack Monk' if you never move the mouse over there?

    Code:
    program Fighter;
    {.include srl\srl.scar}
    
    const
    Monster = 12172221;
    Betweentime = 3;
    
    function FindMonk: Boolean;
    begin;
    if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
      Result:= True
    end;
    
    Begin
      SetupSRL;
      ActivateClient;
      repeat
        wait((Betweentime * 1000) + random(300));
        if(FindMonk) then
        begin
          MMouse(x,y,2,2);
          Wait(50);
          if (IsUpText('Attack Monk')) then
            Mouse(x, y, 10, 10, True);
        end;
      until(not(LoggedIn))
    end.

  12. #12
    Join Date
    Nov 2006
    Location
    California, USA
    Posts
    336
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I thought I had typed in MMouse(x y, 5, 5); My mistake

  13. #13
    Join Date
    Jun 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try "popup". Thats what I use.

  14. #14
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Yea I said that as soon I read "you right click, then click Attack" but nobody listens lol.

  15. #15
    Join Date
    Nov 2006
    Location
    California, USA
    Posts
    336
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I didn't listen because if the UpText says Attack Monk then there is no point in right clicking other than for the healing part.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to detect a virus
    By kingarabian in forum Computer Help and Tutorials
    Replies: 15
    Last Post: 09-27-2009, 06:50 AM
  2. Detect other players?
    By spamthis in forum OSR Help
    Replies: 5
    Last Post: 10-09-2008, 11:58 PM
  3. Replies: 5
    Last Post: 07-26-2008, 08:16 AM
  4. detect health?
    By Mistagnerd in forum OSR Help
    Replies: 11
    Last Post: 11-12-2007, 07:46 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
  •