Results 1 to 13 of 13

Thread: Browser Scroll

  1. #1
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Browser Scroll

    I'm using simba to automate a simple task in my browser.

    Currently i'm using the code below to scroll using the right hand side bar on my chrome browser.

    Code:
    procedure scroll_4();
    begin
      mouse(944, 1005, 1);
      HoldMouse(944, 1005, mouse_Left);
      wait(800);
      ReleaseMouse(944, 1005, mouse_Left);
      wait(2000);
    end
    It uses a wait time and sometimes i find it a little unaccurate. Is there any better way to scroll down on a browser?

    Perhaps scroll by the amount of pixels? Any help would be great, thank you.

    Edited:

    Just a thought, i could drag the bar down a certain amount of pixels. I think that may be more accurate.
    Last edited by matthew98; 08-10-2018 at 02:44 PM.

  2. #2
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by matthew98 View Post
    It uses a wait time and sometimes i find it a little accentuate.
    I'm not sure what exactly accentuate is supposed to mean in this context, but I would recommend considering using something like waitfunc over waits in most of your script, regardless of it helping solve this specific issue. That way you're waiting until something happens (or doesn't happen), rather than simply waiting a predetermined amount of time.

    Quote Originally Posted by matthew98 View Post
    Is there any better way to scroll down on a browser?
    idk about better for you, but yes there are alternative ways a person could use to scroll down. You may wish to research the alternatives and test them out.

    Quote Originally Posted by matthew98 View Post
    Perhaps scroll by the amount of pixels?
    Would likely need to execute javascript code for that level of control, e.g. window.scrollBy()

  3. #3
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Can you post a screenshot where you would like the scroll bar to stop/?

  4. #4
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Could you use the arrow keys or PgUp/PgDown? Might be more precise than manipulating a scroll bar, since they differ from browser to browser and change as the length of the page changes.

    Ctrl+F will also snap you to whatever is found as you search. Perhaps you could have your script use Ctrl+F?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  5. #5
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by acow View Post
    Would likely need to execute javascript code for that level of control
    How would i use javascript in pascal?

  6. #6
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Could you use the arrow keys or PgUp/PgDown? Might be more precise than manipulating a scroll bar, since they differ from browser to browser and change as the length of the page changes.

    Ctrl+F will also snap you to whatever is found as you search. Perhaps you could have your script use Ctrl+F?
    That's genius. I will give the page down a try. That looks like it would work much better.

    Do you know what the key number would be for page down and up? Struggling to find it.

    Thank you.

  7. #7
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Found it 34

  8. #8
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by matthew98 View Post
    How would i use javascript in pascal?
    btw just to be clear, I wasn't trying to recommend you scroll by X pixels w/ javascript. Just answering your question with a yes it's possible but you'd likely need to execute javascript for that specific functionality.

    Anyways, to answer your question here, the exact same ways as a human could. However ways a human could manually execute javascript code when on somebody else's website, you could easily do the same via simba. There's multiple ways to do that, a quick google search should give a couple of the options for that. Not that I'm recomending you execute javascript for this project that I know almost nothing about.

  9. #9
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Try using this:
    Simba Code:
    Begin
                        KeyDown(VK_Down);
                        wait(600);
                        KeyUp(VK_Down);
      End;

  10. #10
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Why not just scroll down until a certain condition is met, verified via color searches (I.e. getColor() or similarColors() or findDTM/Bitmap)? Presumably you are scrolling down until you see some page element in the window?

    Maybe if you elaborate on the task you are trying to do we can provide more specific answers.
    Last edited by Clarity; 08-10-2018 at 04:49 PM.

  11. #11
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Umm... I'll just leave this here.

    http://docs.villavu.com/simba/scriptref/mouse.html

    Simba Code:
    ActivateClient();
    ScrollMouse(0, 0, numClicks); //numClicks = 'steps'

  12. #12
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Quote Originally Posted by the bank View Post
    Umm... I'll just leave this here.

    http://docs.villavu.com/simba/scriptref/mouse.html

    Simba Code:
    ActivateClient();
    ScrollMouse(0, 0, numClicks); //numClicks = 'steps'
    Ding ding ding! We got a winner

  13. #13
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by the bank View Post
    Umm... I'll just leave this here.

    Simba Code:
    ActivateClient();
    ScrollMouse(0, 0, numClicks); //numClicks = 'steps'
    Thank you!!

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
  •