Page 2 of 8 FirstFirst 1234 ... LastLast
Results 26 to 50 of 197

Thread: OpenGL - A Beginner's Scripting Tutorial

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

    Default

    Quote Originally Posted by HKbotz View Post
    Having an issue where the model IDs and actual models don't line up, and the ID is way off centered from the model, so when I click it clicks where the ID is, which is nowhere close to the model.

    Any ideas why this is and how to fix it?

    The model for the chicken I want is circled along with the ID and as you can see it's way off.

    Attachment 25457
    You should not be using SRL-6 settings/old school layout. Use Resizeable graphics mode. If you really want to use SRL-6, you will have to call GLXViewport(); after setting up OGL, but this limits your capabilities a lot imo.

  2. #27
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    You should not be using SRL-6 settings/old school layout. Use Resizeable graphics mode. If you really want to use SRL-6, you will have to call GLXViewport(); after setting up OGL, but this limits your capabilities a lot imo.
    Thanks, changing it to RS3 default and resizable seems to have fixed it.
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

  3. #28
    Join Date
    Apr 2014
    Posts
    33
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    0. We have run scripts for months with absolutely no mouse movement. However, we take great care to randomize timing, since mouse movements = time. I often add in mouse movements not to have movement, but to create realistic timing between clicks.
    I think this sort-of makes sense, if they banned based on not having mouse movements then anyone who played rs from a tablet to a desktop via teamviewer would be on the chopping block. I would imagine that being a somewhat common practice...

  4. #29
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by falloutboy12 View Post
    I think this sort-of makes sense, if they banned based on not having mouse movements then anyone who played rs from a tablet to a desktop via teamviewer would be on the chopping block. I would imagine that being a somewhat common practice...
    It's what I assumed aswell.
    When new functions will be added, will they be added to this guide? Or shall I just explore the includes?

    Scripting seems rather weird for now though, the reactions are completely new to me!

  5. #30
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    0. We have run scripts for months with absolutely no mouse movement. However, we take great care to randomize timing, since mouse movements = time. I often add in mouse movements not to have movement, but to create realistic timing between clicks.
    If you're adding time between clicks, why not just replace that with mouse movements?

    Forum account issues? Please send me a PM

  6. #31
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Quite simply put... Because I don't want to. Jumping the mouse is more accurate, don't have to worry about the model having changed positions, etc. And adding a:
    Simba Code:
    if canMoveMouse.isFinished() then
    Beats adding a mouse movement.

    I'm sure eventually I'll have the functions "follow" the models, but until then.

    @love, you're making drastic changes (if you can call that drastic) for minimal improvement. I keep all mine zoomed all the way out and 1024x768, making the 3D world 100%.




    Skype: obscuritySRL@outlook.com

  7. #32
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    @love, you're making drastic changes (if you can call that drastic) for minimal improvement. I keep all mine zoomed all the way out and 1024x768, making the 3D world 100%.
    I'm unsure if it would be minimal improvement? If 3D world is scaled to about 500v350, thats 4x less area I would have to render. I'm mainly going to use this for a gold farm, so I do care about resources needed.

  8. #33
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    We've just found that Jagex doesn't detect whether the mouse is moving, only the time/location (and respective trends) associated with clicks.
    Hey, that's very interesting. How did you find it out?

    Quote Originally Posted by Obscurity View Post
    I'm sure eventually I'll have the functions "follow" the models, but until then.
    I have already a function following models using TrackingMouse ,it's pretty accurate (I'v never noticed missclick). The only problem I have (not just with this function, with everything) is static model's point adjustment. glModel starts near the ground, so you adjust y position to not click everytime on legs of NPC, but in the middle. But if you zoom out/increase camera angle, this point may be off,usually above the head of NPC. Is there any way to get current zoom and vertical angle of camera with OGL ?

    @edit
    for camera angle I see the function from you lib
    Last edited by bg5; 04-02-2015 at 03:32 PM.

  9. #34
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Current camera night isn't in the ogLib yet. It's obscurityLibrary.

    But Jagex, some time ago, actually mentioned and discussed logs they had had on a player. No movements were mentioned. And on top of that, there are too many legit means of jumping the mouse (I play on a touch screen for example) now-a-days.




    Skype: obscuritySRL@outlook.com

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

  11. #36
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    mouse.rightClickOption() is not working for me. It just right clicks then moves mouse to close the options. I made sure the text is spelled right, including upper/lower case, and reduced the text so it was just part of the word and it still wasn't working. Any ideas why?

    All I did was use a tpoint and text when calling it.
    Simba Code:
    mouse.rightClickOption(p, 'Take Feather'); //p is a TPoint
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

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

    Default

    Quote Originally Posted by HKbotz View Post
    mouse.rightClickOption() is not working for me. It just right clicks then moves mouse to close the options. I made sure the text is spelled right, including upper/lower case, and reduced the text so it was just part of the word and it still wasn't working. Any ideas why?

    All I did was use a tpoint and text when calling it.
    Simba Code:
    mouse.rightClickOption(p, 'Take Feather'); //p is a TPoint
    On the phone, so I can't check this, but try (p, ['Take Feather']) instead.

  13. #38
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    On the phone, so I can't check this, but try (p, ['Take Feather']) instead.
    It still doesn't work. Same result. I think it has something to do with how ogl is reading the characters, because when I get all the characters with ogl.getChars() I see the majority of them repeated.
    For example this is a chunk of all the text ogl grabs from the screen.

    Code:
    [[PPrreessssEEnntteerrttooCChhaatt]]YYoouuhhaavveeggaaiinneedd8833bboonnuusseexxppeerriieenncceeppooiinnttssiinntthheeSSllaayyeerrsskkiillll..YYoouurrpprriizzeehhaassbbeeeennppllaacceeddiinnyyoouurriinnvveennttoorryy
    That is the bit of text from the chatbox, and as you can see all of the letters are repeated.
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

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

    Default

    Quote Originally Posted by HKbotz View Post
    It still doesn't work. Same result. I think it has something to do with how ogl is reading the characters, because when I get all the characters with ogl.getChars() I see the majority of them repeated.
    For example this is a chunk of all the text ogl grabs from the screen.

    Code:
    [[PPrreessssEEnntteerrttooCChhaatt]]YYoouuhhaavveeggaaiinneedd8833bboonnuusseexxppeerriieenncceeppooiinnttssiinntthheeSSllaayyeerrsskkiillll..YYoouurrpprriizzeehhaassbbeeeennppllaacceeddiinnyyoouurriinnvveennttoorryy
    That is the bit of text from the chatbox, and as you can see all of the letters are repeated.
    That shouldn't be the problem. ogLib already parses through those. The doubled characters you are seeing are the real characters and their shadow characters (black equivalents), which are automatically filtered. One second, I'm going to test whether it works for me.

    E: Just tested a Jadinkos script with the following code:

    Simba Code:
    mouse.rightClickOption(ogl.getClientMidPoint().closest(ogl.getTextures(INVENTORY_TRAP_ID))[i].randomizePoint(36, 32), 'Lay Marasamaw plant');

    Worked for me. Could you post some screenshots, and more contextual code, please?
    Last edited by Clarity; 04-06-2015 at 05:05 AM.

  15. #40
    Join Date
    Nov 2014
    Posts
    33
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Quote Originally Posted by HKbotz View Post
    mouse.rightClickOption() is not working for me. It just right clicks then moves mouse to close the options. I made sure the text is spelled right, including upper/lower case, and reduced the text so it was just part of the word and it still wasn't working. Any ideas why?

    All I did was use a tpoint and text when calling it.
    Simba Code:
    mouse.rightClickOption(p, 'Take Feather'); //p is a TPoint
    Just wondering, is your mainscreen fully stretched?

    E: nvm misread as 'close to the options'
    Last edited by ignorant; 04-06-2015 at 06:01 AM.

  16. #41
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    That shouldn't be the problem. ogLib already parses through those. The doubled characters you are seeing are the real characters and their shadow characters (black equivalents), which are automatically filtered. One second, I'm going to test whether it works for me.

    E: Just tested a Jadinkos script with the following code:

    Simba Code:
    mouse.rightClickOption(ogl.getClientMidPoint().closest(ogl.getTextures(INVENTORY_TRAP_ID))[i].randomizePoint(36, 32), 'Lay Marasamaw plant');

    Worked for me. Could you post some screenshots, and more contextual code, please?

    Yeah I had a feeling it had something to do with that, although I didn't realize it automatically parsed everything.

    Here is the function:

    Simba Code:
    function getLoot(): boolean;
    var
      featherOGM: glModelArray; //ID: 2194333806
      p: TPoint;
    begin
      result := false;
      repeat
        featherOGM := ogl.getModels(2194333806);
        if (featherOGM.isEmpty()) then
        begin
          writeln('No feathers found.');
          break;
        end;
        p := ogl.getClientMidPoint().closest(featherOGM)[0].randomizePoint(10, 10);
        if (mouse.rightClickOption(p, ['Take Feather']) and (not result)) then
          result := true;
        //wait(gaussRangeInt(200, 500));
      until (featherOGM.isEmpty());
    end;

    It just right clicks over and over on the feather without ever selecting an option.

    Here is a screenshot with it right clicking.
    oglRightClicking.png
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

  17. #42
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    That is very strange. I have a few ideas of what it could be but I'm at work until 2:45. You said it's succesfully closing the menu when it doesn't find it? Is it doing it by moving the mouse up?

    If it's not moving the mouse slightly up to close it, and seems like it's just moving it randomly, try adjusting your color tolerance with OGl.setColourTolerance(). I think it's 4 by default - try lowering and raising it.

    Are a few other things to try but those will be when I'm home.

    Putting the string into an array won't change it.




    Skype: obscuritySRL@outlook.com

  18. #43
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    That is very strange. I have a few ideas of what it could be but I'm at work until 2:45. You said it's succesfully closing the menu when it doesn't find it? Is it doing it by moving the mouse up?

    If it's not moving the mouse slightly up to close it, and seems like it's just moving it randomly, try adjusting your color tolerance with OGl.setColourTolerance(). I think it's 4 by default - try lowering and raising it.

    Are a few other things to try but those will be when I'm home.

    Putting the string into an array won't change it.
    It seems to move the mouse up and to either side, with a range of around 60-70 pixels maybe?(just glanced at it, didn't measure) So it's random, but always up and off to either side and within a certain distance. I will try the color thing when I have more free time. Term started last week so I've been busy with school.

    Clarity suggested trying it in an array to see if there was any change and I just didn't bother changing it back, so that's why it's in an array

    E: Tried changing the color tolerance and still no difference.
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

  19. #44
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Thanks for this, going to try converting some over to this since Jagex is breaking down on color bots.

    Edit : Sweet got it working
    Last edited by Lucidity; 04-09-2015 at 09:58 AM.
    Tsunami

  20. #45
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Decided to mess around, got a fletcher going but it's not the best. Definitely could use some work lol

    Thanks for this, it's more easy and actually quite fun

    Simba Code:
    program fletchVarrockBigBank;
    {$i ogLib\lib\core\core.simba}

    var
      clientCenter: TPoint;


    procedure rotateCamera;
    begin
      minimap.setDegrees(random(245, 270));
      writeln('Rotated camera West');
      wait(1000);
    end;

    procedure mainLoop;
    var
      allModels, bankerModels: glModelArray;
      clickPoint, clickPoint2: TPoint;
      LogTextures: glTextureArray;
    begin
      LogTextures := ogl.getTextures(116280);
      bankerModels := allModels.getModels(192931521);
      allModels := ogl.getModels(192931521);
      clickPoint := clientCenter.closest(allModels)[0];
      clickPoint2 := clientCenter.closest(LogTextures)[0];
      if allModels.isEmpty() then
        writeln('No banker exists.');
        if clientCenter.closest(allModels)[0].isBehindInterface() then
          rotateCamera
        else
          mouse.rightClickOption(clickPoint, 'Bank');
          writeln('Opened bank');
          wait(random(1000, 2000));
          writeln('Clicked preset 2');
          bank.clickPreset(2);
          mouse.rightClickOption(clickPoint2, 'Craft');
          wait(random(500, 700));
          if production.hasChooseATool() then
          production.setProduct(2);
          wait(random(100, 300));
          production.clickMake();
          wait(random(51000, 55000));
    end;

    begin
      ogl.setup(1067, 667);
      ogl.setDebugMode('models');
      clientCenter := ogl.getClientMidPoint();
      repeat
        mainLoop();
      until false;
    end.
    Last edited by Lucidity; 04-09-2015 at 08:52 PM.

  21. #46
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

    Still delving into this, heard you made a PC script off it, I can see how much easier this likely made it!
    BTW, I can't seem to get it to debug...I grabbed the folders mentioned and ensured I had everything setup exactly as shown. Ideas on what I'm doing wrong?
    Last edited by Clutch; 04-10-2015 at 07:21 AM.

  22. #47
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Make sure your graphics are set to OpenGL and 3D world is 100% sized.

    Also, I finished the PC bot yesterday. Picks a random portal and camps it for a good 10-is just games before picking another. 150 lines exact.




    Skype: obscuritySRL@outlook.com

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

    Default

    Quote Originally Posted by Clutch View Post
    Still delving into this, heard you made a PC script off it, I can see how much easier this likely made it!
    BTW, I can't seem to get it to debug...I grabbed the folders mentioned and ensured I had everything setup exactly as shown. Ideas on what I'm doing wrong?
    If you're having problems, please post screenshots!

  24. #49
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    Make sure your graphics are set to OpenGL and 3D world is 100% sized.

    Also, I finished the PC bot yesterday. Picks a random portal and camps it for a good 10-is just games before picking another. 150 lines exact.
    First time ever hearing about this 3D world thing, that wasn't enabled/setup right. Tried to enable it via teamviewer into my machine...horrid connection so won't be able to find out til tonight.
    150 lines...that must be nice. I think mine was around 500 and didn't even complete it!

    Okay, still not working. @Clarity @Obscurity
    Capture.PNG
    Capture1.PNG
    Last edited by Clutch; 04-11-2015 at 01:22 AM.

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

    Default

    Quote Originally Posted by Clutch View Post
    First time ever hearing about this 3D world thing, that wasn't enabled/setup right. Tried to enable it via teamviewer into my machine...horrid connection so won't be able to find out til tonight.
    150 lines...that must be nice. I think mine was around 500 and didn't even complete it!

    Okay, still not working. @Clarity @Obscurity
    Capture.PNG
    Capture1.PNG
    PM me your TeamViewer information.

    Edit: Problem solved over TV
    Last edited by Clarity; 04-11-2015 at 01:56 AM.

Page 2 of 8 FirstFirst 1234 ... LastLast

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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