Results 1 to 7 of 7

Thread: please help

  1. #1
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default please help

    the problem is:
    The "functiond" doesn't change in the mind of your proc until its called again, so, if I call YourFunction(...False) it would think of it as false until I say otherwise.
    n3ss3s told me that then got off b4 helping me, the code is:
    SCAR Code:
    function WaitUntil(WaitEach, AmountTries: Integer; functiond : boolean): boolean;
    var
      waitedd : integer;
    begin
      Result := False;
      waitedd := 0;
      repeat
        wait(WaitEach);
        if (Functiond) then break;
        inc(waitedd);
      until (waitedd >= AmountTries);
      if (waitedd >= AmountTries) then EXIT;
      Writeln('Found The W/E yu were waiting to find!');
      Writeln('We Waited ' + IntToStr(waitedd * WaitEach) + ' MiliSeconds');
      Result := True;
    end;
    useage is:
    SCAR Code:
    waitUntil(50, 14, FindDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2);
    or
    SCAR Code:
    waitUntil(50, 14, FindColor( x, y, 128, MIX1, MIY1, MIX2, MIY2);
    or any boolean returning value can be used.
    my problem is that if its not ture to begin with, it just dosn't seem to check again.. IE if im waiting until theres a red dot somwhere, if the dot is there to start it breaks out of the loop, but if the dot shows up b4 the repeat loop fineshes, it still don't find it...
    thanks!
    ~footballjds

  2. #2
    Join Date
    Jan 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Administrator's Warning:
    Dear User,
    Your post count has been reset on account of your mass of spam posts. Please take the time to read this thread before posting again.
    Sticky: Attention Spammers and Leechers...
    RAM

    Cheers,
    Nielsie95


    i dont get scarscape wut exactly is so good about it compared to other things?

    idk nething about this stuff im learning D:

    wuts the longest time no biggie there o_o

    mines small its like 1 hour lmao i sat here and did hw and i got a random that the script couldnt do so i had to stop it and do the random =\

    welcome im new too :P lol

    that seems like just a lie to me o_o

    ya wut the 1st dude put its stupid cause there should be some sorta thing on there so that u can like downgrade if u want and it comes with drivers but noooooooooo.... meanies =[

    the 1st ones funny :P and lol i bet sum idiot didnt read and got banned and feels like an idiot for not paying attention :P or sum1 will sooner or l8er

    woah wicked stuff goin on here ya idk nething about scripting yet xD but looks cool to meh :P

    ya id help if i kne how to do any of this o_o i hope sum1 comes along now to help

    wait so u dont hafta like install XP and then install all the drivers again? u can do sumtin else cause i didnt think there was ne other way and i asked people about that when i reimaged my comp and asked about my dads new laptop o_o

    rofl i gotta be around for the dead to rise thatd be wicked sweet to kill zombies

    oh wuts our stoopd(yes i spelled that wrong on purpose) president george bush got in his future? :P

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    The problem is that it only sets the Result of FindDTM or FindColor at the beginning of the script. If you want it to be changed during the script, then you have to include it in your loop. A way to do this while still having the option of having FindDTM or FindColor would be:
    SCAR Code:
    function WaitUntil(WaitEach, AmountTries,Color,DTM: Integer; Use: Boolean): boolean;
    var
      waitedd : integer;
    begin
      Result := False;
      waitedd := 0;
      repeat
        wait(WaitEach);
        if(Use) then
          Result:= FindColor(x,y,Color,MIX1, MIY1, MIX2, MIY2)
        else
          Result:= FindDTM(DTM,x,yMIX1, MIY1, MIX2, MIY2);
        inc(waitedd);
      until ((waitedd >= AmountTries) or (Result));
      if (waitedd >= AmountTries) then EXIT;
      Writeln('Found The W/E yu were waiting to find!');
      Writeln('We Waited ' + IntToStr(waitedd * WaitEach) + ' MiliSeconds');
      Result := True;
    end;
    And you'd then use it as
    SCAR Code:
    WaitUntil(250,120,0,DTMLogs,False)
    or
    SCAR Code:
    WaitUntil(250,120,DotColor,0,True)

    Hope this helps

  4. #4
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    but i want it to work FOR EVERY boolean returning value..
    i came up with a great IDEA, run the functiond everytime and check to see if x and y = 0; and b4 the loop il set x and y to 0. because find color tol and finddtm and that sort.. changes the value of x and y if theyre found. =p

  5. #5
    Join Date
    Jan 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wooooooooooo i dont get it

  6. #6
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    MarkTime(I);
    repeat
      wait(10+random(10));
      if FindDTM(thedtm, x, y, X1, Y1, X2, Y2) then break;
      if TimeFromMark = 500000 then break;
    until (False);
    if TimeFromMark >= 500000 then
    begin
      Result := False;
      Exit;
    end;
    Result := True;
    Exit;
    Is this what you're trying to do? I'm not sure if I understand, because N3ss is saying that you declare False or True yourself...That it remains false, and it never changes. You shouldn't have it in the ( ).
    Active only during the Summer...

  7. #7
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    He wants to be able to use it with any Function that returns a boolean value(FindDTM, FindColor, FindBitmap etc.). I thought about it for a bit, and came up with a more or less simple method, though it will look kind of messy in your main script.
    SCAR Code:
    Repeat
      bool:= FindColor(x,y,color,MSX1,MSY1,MSX2,MSY2));
      Waintuntil(250,120,bool);
    Until(bool)
    But for that to work, you'd have to take out numerous bits from WaitUntil and put that into the repeat.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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