Page 3 of 8 FirstFirst 12345 ... LastLast
Results 51 to 75 of 197

Thread: OpenGL - A Beginner's Scripting Tutorial

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

    Default

    So I have noticed when doing

    mouse.click(ogl.getClientMidPoint().closest(exampl e)[0].randomizePointEllipse(15));
    It does in fact find objects, it DOES NOT find the closest and on occassion it will try clicking through interfaces to do so resulting in it getting hung up. Is there something to do about this outside of adding in something to detect the multiple different interfaces it "might" open and then adding a rotatecamera so it can hopefully successfully click?

    Also I get Error: Access violation
    Execution failed.
    The following bitmaps were not freed: [0]
    fairly frequently know what that's all about? Sometimes it crashes simba, sometimes I just need to hit play 3-4 times til it goes through.

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

    Default

    Quote Originally Posted by Clutch View Post
    So I have noticed when doing

    mouse.click(ogl.getClientMidPoint().closest(exampl e)[0].randomizePointEllipse(15));
    It does in fact find objects, it DOES NOT find the closest and on occassion it will try clicking through interfaces to do so resulting in it getting hung up. Is there something to do about this outside of adding in something to detect the multiple different interfaces it "might" open and then adding a rotatecamera so it can hopefully successfully click?

    Also I get Error: Access violation
    Execution failed.
    The following bitmaps were not freed: [0]
    fairly frequently know what that's all about? Sometimes it crashes simba, sometimes I just need to hit play 3-4 times til it goes through.
    TPoint.isBehindInterface()

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

    Default

    writeLn(example.Indexes()' ');
    I know myself and @renzanity; are having issues with this, we've tested trees, birds, fishing locations and more and even though there are clearly multiple models, it is only printing out that there is 1. Anyone know why this is?

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

    Default

    4 indexes: [{ID = 1731643360, TID = 180, X = 383, Y = 175}, {ID = 1731643360, TID = 180, X = 708, Y = 139}, {ID = 547053328, TID = 175, X = 554, Y = 102}, {ID = 617765920, TID = 186, X = 839, Y = 186}]
    Mine is working fine.

    What happens if you try:
    Simba Code:
    writeLN(example.indexes(),' indexes: ',example);

    Keep in mind that while trees and monsters might look identical, some can have different IDs.




    Skype: obscuritySRL@outlook.com

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

    Default

    Quote Originally Posted by Obscurity View Post
    Mine is working fine.

    What happens if you try:
    Simba Code:
    writeLN(example.indexes(),' indexes: ',example);

    Keep in mind that while trees and monsters might look identical, some can have different IDs.
    Will try that out when I get home from work, Now that you mention having different IDs that could just be it...It's hard to find the IDs on trees as it puts the Tree and stump model on top of each other so you have to decipher through the debug lines and hope you get it right..

    Also I've been looking through the library and saw there was a SRL compatibility, is this what we should use to login? I was seeing some code regarding login but not quite sure how/if to use that. Yes, I saw you guys didn't want to spoonfeed so if needed just ignore this last part.

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

    Default

    Zoom in as far as you can, so that they're some of the only few models on screen. It's easy to tell if it's the correct ID by copying a writeLN(ogl.getModels()) and comparing coordinates. .




    Skype: obscuritySRL@outlook.com

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

    Default

    Quote Originally Posted by Obscurity View Post
    Zoom in as far as you can, so that they're some of the only few models on screen. It's easy to tell if it's the correct ID by copying a writeLN(ogl.getModels()) and comparing coordinates. .
    Yeah, I do zoom in, they're still literally on top of eachother, I'll do a search for the coordinates though! Thanks!

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

    Default

    Well yeah, they'll be ontop of each other, but it narrows the amount of results returned by ogl.getModels() by like 10000000%. :P.




    Skype: obscuritySRL@outlook.com

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

    Default

    Quote Originally Posted by Obscurity View Post
    Mine is working fine.

    What happens if you try:
    Simba Code:
    writeLN(example.indexes(),' indexes: ',example);

    Keep in mind that while trees and monsters might look identical, some can have different IDs.
    Indexes.jpg
    Tested on all the locations I had mentioned earlier as well and they still only show 1. Although, I did check out troll brutes and those showed up perfectly. Not sure why...

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

    Default

    Well, that's rather curious - mind adding me on Skype?

    Edit: Figured it out over TeamViewer - I'm retarded. Will have a fix out soon. Is only the ogl.getModels(uInt32) function and some texture functions.




    Skype: obscuritySRL@outlook.com

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

    Default

    Quote Originally Posted by Obscurity View Post
    Well, that's rather curious - mind adding me on Skype?

    Edit: Figured it out over TeamViewer - I'm retarded. Will have a fix out soon. Is only the ogl.getModels(uInt32) function and some texture functions.
    Can you expand on this a bit? I'm having a similar issue and I'm not sure I understand what you did to resolve your issue...

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

    Default

    Update. I had OGL.getModels(uInt32) break after the first result because it was originally OGL.getModel(uInt32)... And forgot to change it back.

    Y'all gotta keep an eye on the development thread - we post every update and fix.




    Skype: obscuritySRL@outlook.com

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

    Default

    Hi everyone, some people have pointed out compiling errors - they are due to ogLib being updated after this tutorial post - I'll edit the first post shortly with the appropriate changes.

    For example, .isBehindInterface() was replaced with the more helpful, superior getVisible(), amongst other changes.

    Sorry for the inconvenience. If you take a look at the development thread, you will see we post every small change or addition promptly after pushing.

  14. #64
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    Quote Originally Posted by Clutch View Post
    So I have noticed when doing

    mouse.click(ogl.getClientMidPoint().closest(exampl e)[0].randomizePointEllipse(15));
    It does in fact find objects, it DOES NOT find the closest....

    Also I get Error: Access violation
    Execution failed.
    The following bitmaps were not freed: [0]
    fairly frequently know what that's all about? Sometimes it crashes simba, sometimes I just need to hit play 3-4 times til it goes through.
    I'm having the same issues as you, sometimes I will get access violations when just trying to compile but they will go away after hitting F9 a bunch or if I quickly target the simba window after enabling and disabling smart. But I am also having problems where closest function is not clicking on the closest object in the array.

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

    Default

    Quote Originally Posted by Brotein View Post
    I'm having the same issues as you, sometimes I will get access violations when just trying to compile but they will go away after hitting F9 a bunch or if I quickly target the simba window after enabling and disabling smart. But I am also having problems where closest function is not clicking on the closest object in the array.
    If you look back at this check the date, I'm gonna edit it as soon as I can (at work)

    Ultimately though the access violation is out of our control. Simba will crash sometimes in which case relaunching the script will solve it, sometimes though you will HAVE to close out of SMART then run the script again, login and then go from there. Annoying, but you'll get used to it and get in the habit of correcting it quickly.

    As for finding the closest object ensure you have the latest ogLib.

    Simba Code:
    var
    funcModelArray:glModelArray;
    funcPointArray:tPointArray;
    funcPointArrayIndex:uInt32=0;
    begin
      if length(funcModelArray:=ogl.getModels(NPC)) then
        begin
          funcPointArray:=ogl.getClientMidPoint().closest(funcModelArray);
          for funcPointArrayIndex to high(funcPointArray) do
            begin
              if not funcPointArray[funcPointArrayIndex].isVisible() then
                begin
              //(0,-40)the offset of clicking opposed to clicking at the base of the model       Pickpocket is your right-click option    mouse.rightClickOption(funcPointArray[funcPointArrayIndex].adjustPosition(0,-40).randomizePointEllipse(20),'Pickpocket');
                  break;
                end
              else if funcPointArrayIndex=high(funcPointArray) then
                mainScreen.setDegrees(normalRandom(0,360),normalRandom(0,50));
            end;
        end;            
    end;
    Last edited by Clutch; 04-16-2015 at 02:30 PM.

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

    Default

    Quote Originally Posted by Brotein View Post
    I'm having the same issues as you, sometimes I will get access violations when just trying to compile but they will go away after hitting F9 a bunch or if I quickly target the simba window after enabling and disabling smart.
    Another vote for constantly battling access violations - is this happening for everybody or is there something specific to my setup that's causing this?

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

    Default

    Quote Originally Posted by falloutboy12 View Post
    Another vote for constantly battling access violations - is this happening for everybody or is there something specific to my setup that's causing this?
    See my post above, it's out of everyone's control at this point and time, I posted some of the fixes though.

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

    Default

    Quote Originally Posted by Clutch View Post
    See my post above, it's out of everyone's control at this point and time, I posted some of the fixes though.
    OK, I can just sit it out for a while but I just want to make sure you understand where I am right now.

    I have the easiest of scripts written to simply find an openGL model and writeln that model. I can see the model ID there on the smart debug but I've never gotten it to output anything. It will either write an empty array or just crash with access violation. This seems worse than what others are experiencing but I've recently replaced some components in my system and reinstalled the OS so I'm trying to make sure that what I'm experiencing is right - it doesn't seem right to me...

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

    Default

    Quote Originally Posted by falloutboy12 View Post
    OK, I can just sit it out for a while but I just want to make sure you understand where I am right now.

    I have the easiest of scripts written to simply find an openGL model and writeln that model. I can see the model ID there on the smart debug but I've never gotten it to output anything. It will either write an empty array or just crash with access violation. This seems worse than what others are experiencing but I've recently replaced some components in my system and reinstalled the OS so I'm trying to make sure that what I'm experiencing is right - it doesn't seem right to me...
    I can TV in and take a look when I get home if you'd like. Just shoot me a PM and we'll discuss further.

    Otherwise, could you clarify on it writing an empty array? Are you talking when you do writeln(ogl.getDebug(); ?
    Although again, the access violation is..to my understanding specific to OGL, I wouldn't hold your breath on a fix for that like I mentioned though, it's easily corrected and will be second nature on quickly fixing it.
    Last edited by Clutch; 04-16-2015 at 03:26 PM.

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

    Default

    Quote Originally Posted by Clutch View Post
    I can TV in and take a look when I get home if you'd like. Just shoot me a PM and we'll discuss further.

    Otherwise, could you clarify on it writing an empty array? Are you talking when you do writeln(ogl.getDebug(); ?
    Although again, the access violation is..to my understanding specific to OGL, I wouldn't hold your breath on a fix for that like I mentioned though, it's easily corrected and will be second nature on quickly fixing it.
    Thanks for the offer - I'll be offline for about 9 hours then I'll try catch you. I can't even get it to output an empty array anymore it's just all access violations but when it was working before it was the result of writeln(ogl.getModels(12...67)) that was never returning anything...

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

    Default

    Quote Originally Posted by falloutboy12 View Post
    Thanks for the offer - I'll be offline for about 9 hours then I'll try catch you. I can't even get it to output an empty array anymore it's just all access violations but when it was working before it was the result of writeln(ogl.getModels(12...67)) that was never returning anything...
    I'll be home from work then, will be awaiting a PM!

  22. #72
    Join Date
    Mar 2013
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Hey are there some examples to use sps in some sort of way with opengl? Or is there another walking method for this?

  23. #73
    Join Date
    Sep 2014
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    this happens all too often

    Compiled successfully in 7004 ms.
    Paired with SMART[2388]
    Error: Access violation
    Execution failed.
    The following bitmaps were not freed: [0]

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

    Default

    After running the script once, hooking a SMART window, ccomment out glxMapHooks() in core.simba.

    You will see a fix for this - as it drives me freaking insane whe writing ogLib.




    Skype: obscuritySRL@outlook.com

  25. #75
    Join Date
    May 2012
    Location
    Texas
    Posts
    60
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Im trying out OGL right now.
    Finally got it working, except for the insanely fast mouse movements. It doesnt seem to be fighting the trolls. I had to comment out Camera rotation since it was rotating 45 degree in opposite directions spontaneously. Also had to comment out the fighting troll part since its not exactly working.

    Will work more on it update:P
    ------------------------------------------------------------------------------------------------------------------
    Fimmy Jallon is here ! Lets get Fimmy!

Page 3 of 8 FirstFirst 12345 ... 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
  •