Results 1 to 4 of 4

Thread: Wait until loaded browser

  1. #1
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Wait until loaded browser

    Hey,

    I was trying to bot some browser games that involves clicking and page loading.
    because of that I've made this procedure for browser-scripts to wait until the browser has fully loaded... It checks the cursor if there's a blue color around it (of the windows-load icon)

    But unfortunately it doesn't work

    Simba Code:
    Procedure Chrome_WaitUntilLoaded;
    var f, mx, my, cx, cy, notload, MouseLoadColor: integer;
    begin
      notload := 0;
      MouseLoadColor := 6643972;
      for f := 1 to 100 do
      begin

        GetMousePos(mx,my)
        if not FindColorTolerance(cx,cy,MouseLoadColor,mx-99,my-99,mx+99,my+99,50) then inc(notload);
        if notload >= 3 then break;
        wait(100);
      end;

      writeln('Waited '+FloatToStr(f*0.1)+'s');
     

    end;

    When I put the tolerance too high, it always sees the loading-color of the mouse, but when the tolerance is too low, it never sees it

    Anyone got a similar function or a way to fix this, any help is apreciated.
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  2. #2
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ill be honest, I think there are easier ways to do this. You could find a color that only appears once the game has loaded then use
    Simba Code:
    While (not findcolorspiraltolerance(your color, x, y, 1, 1, 100, 100, 5) do
    wait(randomrange(200,300));
    For example, this can be used when waiting for runescape to load. You can set that color to the blue "log in with facebook" button, then it will wait until it see's the blue button, then exit the loop. Would this work for your game?
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  3. #3
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by Foooty View Post
    Ill be honest, I think there are easier ways to do this. You could find a color that only appears once the game has loaded then use
    Simba Code:
    While (not findcolorspiraltolerance(your color, x, y, 1, 1, 100, 100, 5) do
    wait(randomrange(200,300));
    For example, this can be used when waiting for runescape to load. You can set that color to the blue "log in with facebook" button, then it will wait until it see's the blue button, then exit the loop. Would this work for your game?
    no because you often see the old page until the new has loaded, or it has to render.. I don't know if that will work ... I also don't think there's another way because I have only the inside of the browser into the client, because else some other functions didnt work with getcolor, it was strange... so I can't pick the loading icon at the top either

    Can someone confirm whether it is possible to see the mouse with your bot or not? because that may be the problem
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  4. #4
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Simba will register what is in the designated client, not what your mouse looks like, perhaps a DTM or a bitmap from on the screen or something like what foooty suggested would be the way to go.

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
  •