Results 1 to 9 of 9

Thread: A small procedure issue.

  1. #1
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    358
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default A small procedure issue.

    Ok so im writing a gnome agility course for my first script.
    Ive read a lot of guides and tuts and I have this so far for the Log obstacle.

    SCAR Code:
    ////////////////////////////////////////////////
    procedure FindLog;  //Find+Walk Across the Log//
      begin             ////////////////////////////
      repeat
        FindColorTolerance(x1,y1,4638,230,120,400,400,10);
        MMouse(x1,y1,2,2)
        wait(700+(300))
       until(IsUpText('ross'))
       if(IsUpText('ross'))then
       Mouse(x1,y1,2,2,true)
       Writeln('Crossing Log')
       wait(3500 + random(300))
     end;

    I was just wondering if this is ok?
    It seems to work fine, but I really want to put one thing on the end of this procedure.
    I want it to know when it has crossed the log.
    I figured that I could just move the mouse to just below the players feet, then if it finds green, it returns "Successfully crossed log" then finishes the procedure, if it cant find the colour then it waits and then starts to look for the log again.
    But I cant workout what I need to use, can anyone help me?

    Thanks in advance
    neG

  2. #2
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im not sure coz i dont have a members account atm but you could use fflag;(waits till the flag is gone(dno if you get a flag tho :P)) or wait until it finds a bitmap of the text you get when youve crossed the log right at the bottom of the screen bit(not sure if there is any and this would only work if you get something like, 'you attemt to cross the plank' then 'you succesfully cross the plank'). or something like inchat('you succesfull cross the plank')

    also, to be more user friendly you can set the log color as a variable like this:
    SCAR Code:
    ////////////////////////////////////////////////
    const
    logcolor = 4638

    procedure FindLog;  //Find+Walk Across the Log//
      begin             ////////////////////////////
      repeat
        FindColorTolerance(x1,y1,logcolor,230,120,400,400,10);
        MMouse(x1,y1,2,2)
        wait(700+(300))
       until(IsUpText('ross'))
       if(IsUpText('ross'))then
       Mouse(x1,y1,2,2,true)
       Writeln('Crossing Log')
       wait(3500 + random(300))
     end;

  3. #3
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    358
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Hey thanks for ur reply!
    When you cross the log there is no Flag in the MiniMap,
    but there IS a chat message.
    "... You make it safely to the other side."

    Now I just need to know how to use it.
    I looked through the SRL manual and this is all I found
    SCAR Code:
    if(IsChatMessage('...Y'))then
    Is that what I would use? I have no idea.
    Thanks

  4. #4
    Join Date
    Nov 2006
    Location
    belgium
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea this will work x'can used it also in his first autosmelter

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

    Default

    BTW, the findcolortolerance will find the top left most color that works, repeating moving to colors to check uptext won't work like that. Look in core/object.scar for functions that look for colors and check uptext in different places.

  6. #6
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    358
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ty Boreas.
    Im now using;
    PHP Code:
    FindObjMultiText(x,y,'limb','over','bsta',329739,4)
    MMouse(x,y,2,2); 
    to look for the log and other objects on the course.
    This works sooo much better!

    I still haven't worked out how to use the chatbox to detect for the Crossed Successfully message.

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

    Default

    If (FindText(x, y, 'You have run out of', smallchars, MCX1, MCY1, MCX2,+
    MCY2)) then Writeln('Found Text')

    from http://www.villavu.com/forum/showthr...?t=4129?t=4915

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

    Default

    Quote Originally Posted by neG View Post
    Hey thanks for ur reply!
    When you cross the log there is no Flag in the MiniMap,
    but there IS a chat message.
    "... You make it safely to the other side."

    Now I just need to know how to use it.
    I looked through the SRL manual and this is all I found
    SCAR Code:
    if(IsChatMessage('...Y'))then
    Is that what I would use? I have no idea.
    Thanks

    If(InChat('Text Here')Then
    //code here

  9. #9
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    358
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Boreas View Post
    If (FindText(x, y, 'You have run out of', smallchars, MCX1, MCY1, MCX2,+
    MCY2)) then Writeln('Found Text')

    from http://www.villavu.com/forum/showthr...?t=4129?t=4915
    Thanks Boreas!
    I have it working correctly now;
    SCAR Code:
    if (FindText(x,y,'make it saf',smallchars,MCX1,MCY1,MCX2,MCY2)) then
      Status('Successfully Crossed Log')
     else FindLog;

    Thanks to everyone who posted!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ok issue with whole script now
    By Magiic in forum OSR Help
    Replies: 1
    Last Post: 08-12-2008, 10:19 PM
  2. issue with walking
    By Magiic in forum OSR Help
    Replies: 0
    Last Post: 08-09-2008, 10:02 PM
  3. Yet again another issue
    By Rubix in forum OSR Help
    Replies: 5
    Last Post: 07-13-2008, 01:35 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
  •