Page 7 of 8 FirstFirst ... 5678 LastLast
Results 151 to 175 of 197

Thread: OpenGL - A Beginner's Scripting Tutorial

  1. #151
    Join Date
    Dec 2011
    Location
    Lubbock, Texas
    Posts
    225
    Mentioned
    3 Post(s)
    Quoted
    93 Post(s)

    Default

    Quote Originally Posted by Swag Bag View Post
    I downloaded the DLLs linked, but I guess they're out of date?
    I did the same and I came to the same conclusion.

    Anyways Lucidity got it working for me and I've been playing around with it for a while.
    This is huge! and awesome! Everything is so fast and super reliable. This could/will be bigger than srl. Keep up the good work!

  2. #152
    Join Date
    Jan 2012
    Location
    in a galaxy far far away
    Posts
    371
    Mentioned
    3 Post(s)
    Quoted
    48 Post(s)

    Default

    how come i get this error: Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 5, column 12 at line 5
    when i try to run anything with ogl.setup(); in it
    >:)

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

    Default

    Quote Originally Posted by chief herb View Post
    how come i get this error: Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 5, column 12 at line 5
    when i try to run anything with ogl.setup(); in it
    What ever script you're running isn't correctly setting up ogLib. What's the full line giving you the error? Try adding like 800,600.




    Skype: obscuritySRL@outlook.com

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

    Default

    Guide updated to reflect the need for ogl.setup(width, height);. This may be altered in the future, but the setup function is now pretty different as you can set the viewport within as well.

    Simba Code:
    ogl.setup([800, 600], [0, 0, 576, 388]);

    The above code would configure ogLib for oldschool settings.
    Last edited by Clarity; 10-22-2015 at 01:57 AM.

  5. #155
    Join Date
    Oct 2014
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Massive thanks for the guide!

  6. #156
    Join Date
    Feb 2013
    Location
    The Boonies
    Posts
    203
    Mentioned
    9 Post(s)
    Quoted
    70 Post(s)

    Default

    I'm having a problem, maybe due to incorrect setup, or maybe something else, I'm not sure, but the model IDs are not aligning with their respective onscreen counterpart, and rendering things not very useful:



    It's a little blurry, but seen above is the problem, and when I try to click the model, it just clicks the actual ID, which is nowhere near the troll. Any advice?

  7. #157
    Join Date
    Dec 2014
    Posts
    48
    Mentioned
    2 Post(s)
    Quoted
    28 Post(s)

    Default

    Quote Originally Posted by Lama View Post
    I'm having a problem, maybe due to incorrect setup, or maybe something else, I'm not sure, but the model IDs are not aligning with their respective onscreen counterpart, and rendering things not very useful:



    It's a little blurry, but seen above is the problem, and when I try to click the model, it just clicks the actual ID, which is nowhere near the troll. Any advice?
    Try going to 'RS3 Default' Interface settings, since you seem to be on Old School Interface at the moment.

    Alternatively, use ogl.setViewPort(0,0,576,388); (see https://villavu.com/forum/showthread...16#post1360316) to continue to use OGL in Old School Interfaces.

  8. #158
    Join Date
    Feb 2013
    Location
    The Boonies
    Posts
    203
    Mentioned
    9 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by meep152 View Post
    Try going to 'RS3 Default' Interface settings, since you seem to be on Old School Interface at the moment.

    Alternatively, use ogl.setViewPort(0,0,576,388); (see https://villavu.com/forum/showthread...16#post1360316) to continue to use OGL in Old School Interfaces.
    Aha, that did it, thanks!

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

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

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

  12. #162
    Join Date
    Jun 2015
    Location
    New Zealand
    Posts
    322
    Mentioned
    2 Post(s)
    Quoted
    131 Post(s)

    Default

    How do I add an auto-login feature to an ogLib script? My current problem is that the script doesn't auto-login, and thus I have to disable SMART, enter login details. Once I'm logged in, I pair Simba to the client, and then start the script. The script then starts a new SMART client and doesn't pair with the original client, thus rendering the script as unusable. Perhaps I'm doing something wrong along the way, but to save me time, is there a way to enter an auto-login feature for ogLib as there is in SRL6?

    Thanks for your time, greatly appreciated.

  13. #163
    Join Date
    May 2012
    Posts
    58
    Mentioned
    2 Post(s)
    Quoted
    23 Post(s)

    Default

    Quote Originally Posted by kiwikiwi View Post
    How do I add an auto-login feature to an ogLib script? My current problem is that the script doesn't auto-login, and thus I have to disable SMART, enter login details. Once I'm logged in, I pair Simba to the client, and then start the script. The script then starts a new SMART client and doesn't pair with the original client, thus rendering the script as unusable. Perhaps I'm doing something wrong along the way, but to save me time, is there a way to enter an auto-login feature for ogLib as there is in SRL6?

    Thanks for your time, greatly appreciated.
    I'll be posting the interface I use for using lobby to select worlds/sort world list later on, here's something that will work for simply logging in for now though.

    Code:
    program ogLib;
    {$i ogLib\lib\core\core.simba}
    
    const
    
      USERNAME = 'user';
      PASSWORD = 'pass';
    
    // Logs in the player. Clicks login, types in info, and presses enter.
    procedure loginPlayer(user, pass : String);
    begin
      repeat
      wait(1000);
      until login.clickLogin();
    
      typeSend(user);
      KeyDown(9);            // Tab Key
      wait(randomrange(20, 50));
      KeyUp(9);
      wait(randomrange(20, 50));
      typeSend(pass);
      wait(randomrange(200, 500));
    
      if (not ogl.getTextures(1261319).isEmpty()) then
        mouse.click(TBox([313, 383, 484, 407]), mouse_LEFT) // Login button
      else
      begin
        writeLn('Error logging in.');
        terminatescript;
      end;
      writeLn('Logged in');
    end;
    
    procedure skipEmail();
    var
      skip : GlTexturearray;
    begin
      skip := ogl.getTextures(91275);
      if (length(skip) = 13) then
        mouse.click(TBox([382, 416, 416, 443])); //Skip email verification
    end;
    
    function clickPlay(): boolean;
    begin
      mouse.click(TBox([340, 525, 350, 535])); // Play Now button
    end;
    
    begin
      ogl.setup([800, 600], [0, 0, 800, 600]);
      if length(ogl.getTextures(3060))>0 then
      begin
        exit; // Already logged in
      end else
      begin
        loginPlayer(USERNAME, PASSWORD);
        wait(1000);
        skipEmail();
        wait(1000);
        clickPlay();
      end;
    
    end.

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

    Default

    Quote Originally Posted by Justin69 View Post
    I'll be posting the interface I use for using lobby to select worlds/sort world list later on, here's something that will work for simply logging in for now though.

    Code:
    program ogLib;
    {$i ogLib\lib\core\core.simba}
    
    const
    
      USERNAME = 'user';
      PASSWORD = 'pass';
    
    // Logs in the player. Clicks login, types in info, and presses enter.
    procedure loginPlayer(user, pass : String);
    begin
      repeat
      wait(1000);
      until login.clickLogin();
    
      typeSend(user);
      KeyDown(9);            // Tab Key
      wait(randomrange(20, 50));
      KeyUp(9);
      wait(randomrange(20, 50));
      typeSend(pass);
      wait(randomrange(200, 500));
    
      if (not ogl.getTextures(1261319).isEmpty()) then
        mouse.click(TBox([313, 383, 484, 407]), mouse_LEFT) // Login button
      else
      begin
        writeLn('Error logging in.');
        terminatescript;
      end;
      writeLn('Logged in');
    end;
    
    procedure skipEmail();
    var
      skip : GlTexturearray;
    begin
      skip := ogl.getTextures(91275);
      if (length(skip) = 13) then
        mouse.click(TBox([382, 416, 416, 443])); //Skip email verification
    end;
    
    function clickPlay(): boolean;
    begin
      mouse.click(TBox([340, 525, 350, 535])); // Play Now button
    end;
    
    begin
      ogl.setup([800, 600], [0, 0, 800, 600]);
      if length(ogl.getTextures(3060))>0 then
      begin
        exit; // Already logged in
      end else
      begin
        loginPlayer(USERNAME, PASSWORD);
        wait(1000);
        skipEmail();
        wait(1000);
        clickPlay();
      end;
    
    end.
    Static coordinates are not the way to go. Hopefully your world selection/sort is much better. I'm sure someone will make use of what you post, though.
    Tsunami

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

    Default

    I thought I was the only o e having that SMART issue! Clarity and Ross and everyone else does that seem to.

    If I end the script and start it again, it'll attempt to load a new SMART exactly twice (which I close SMART and rerun the script each time), and the third it'll pair.




    Skype: obscuritySRL@outlook.com

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

    Default

    Quote Originally Posted by Obscurity View Post
    I thought I was the only o e having that SMART issue! Clarity and Ross and everyone else does that seem to.

    If I end the script and start it again, it'll attempt to load a new SMART exactly twice (which I close SMART and rerun the script each time), and the third it'll pair.
    Quote Originally Posted by kiwikiwi View Post
    How do I add an auto-login feature to an ogLib script? My current problem is that the script doesn't auto-login, and thus I have to disable SMART, enter login details. Once I'm logged in, I pair Simba to the client, and then start the script. The script then starts a new SMART client and doesn't pair with the original client, thus rendering the script as unusable. Perhaps I'm doing something wrong along the way, but to save me time, is there a way to enter an auto-login feature for ogLib as there is in SRL6?

    Thanks for your time, greatly appreciated.
    I believe this can happen when you make a habit of forcibly terminating scripts (pressing stop, then pressing the circular red X rather than waiting). This isn't a great thing to do because it bypasses anything in the termination procedure, such as freeing SMART, bitmaps, DTMs, etc.

    I might be wrong though. If you don't have this habit, then it's clearly something else.

    Regarding the login procedures, I've never really needed to use auto-login in my entire life so it's been a low priority for me. Most likely we will look at the currently posted methods by other people, optimize them, and push them.
    Last edited by Clarity; 12-18-2015 at 04:57 AM.

  17. #167
    Join Date
    Dec 2015
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default

    Thanks so much for making this guide! Super helpful!

  18. #168
    Join Date
    Dec 2015
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks for this super guide !! Will be trying to script myself soon exciting idea

  19. #169
    Join Date
    Dec 2011
    Location
    UK
    Posts
    87
    Mentioned
    2 Post(s)
    Quoted
    42 Post(s)

    Default

    Writing a script at the moment, I have hit a dialogue box after right clicking the model and choosing the option, I need the script to engage the dialogue box, how do I do that in OGL?
    Only the weak surrender.
    .

  20. #170
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by Mar-TINO View Post
    Writing a script at the moment, I have hit a dialogue box after right clicking the model and choosing the option, I need the script to engage the dialogue box, how do I do that in OGL?
    all functions are in ogLib/lib/interfaces/dialogue.simba

  21. #171
    Join Date
    Dec 2011
    Location
    UK
    Posts
    87
    Mentioned
    2 Post(s)
    Quoted
    42 Post(s)

    Default

    Thanks.

    Quote Originally Posted by Ross View Post
    all functions are in ogLib/lib/interfaces/dialogue.simba
    Only the weak surrender.
    .

  22. #172
    Join Date
    Dec 2014
    Posts
    188
    Mentioned
    3 Post(s)
    Quoted
    100 Post(s)

    Default

    The "Attachment 26861" for automatic installation is invalid.

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

    Default

    Thanks, @Hitac; I'll have a look when I get home from work.




    Skype: obscuritySRL@outlook.com

  24. #174
    Join Date
    Feb 2014
    Posts
    84
    Mentioned
    0 Post(s)
    Quoted
    28 Post(s)

    Default

    When running ogLib-Setup I get this error: Unknown declaration "init" at line 49

    Refers to this line:
    _Socket.init();

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

    Default

    Update ProSocks




    Skype: obscuritySRL@outlook.com

Page 7 of 8 FirstFirst ... 5678 LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •