Page 5 of 8 FirstFirst ... 34567 ... LastLast
Results 101 to 125 of 197

Thread: OpenGL - A Beginner's Scripting Tutorial

  1. #101
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    I've tried the models but it didn't show me any model id's.

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

    Default

    Quote Originally Posted by Yush Dragon View Post
    I've tried the models but it didn't show me any model id's.
    Could you explain your issue a bit more, perhaps with screenshots? I don't understand how that would happen if textures worked for you.

  3. #103
    Join Date
    Oct 2014
    Location
    With ezreal~
    Posts
    295
    Mentioned
    45 Post(s)
    Quoted
    255 Post(s)

    Default

    Quote Originally Posted by Yush Dragon View Post
    I've tried the models but it didn't show me any model id's.
    Have you enabled the oglDebug in teh SMART window?



    It's not gay if it's efficient.

  4. #104
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    I do. When I used the models debugmode, it didn't show me the fishing spots. It showed me players and when I wanted to let it kill some chickens, it showed me the chicken id's aswell. Fishing spots = the bubbling water that you can click on.

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

    Default

    Quote Originally Posted by Yush Dragon View Post
    I do. When I used the models debugmode, it didn't show me the fishing spots. It showed me players and when I wanted to let it kill some chickens, it showed me the chicken id's aswell. Fishing spots = the bubbling water that you can click on.
    Which, again, are models. Please show screenshots.

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

    Default

    I'm happy to announce that code hints and the function list are fully supported now in the latest ogLib update. This should be make starting out with the include a lot easier and lead to faster, more fun scripting!

    Enjoy

    I'll be right back with the guide update now.

    Last edited by Clarity; 06-01-2015 at 01:34 AM.

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

    Default

    Nvm i'll just send over skype

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

  9. #109
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    What's up with the access violation?

  10. #110
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    And here's the picture:

  11. #111
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Ok, I found the right modelid.

    For people that wonder what the fishingspot modelid is:
    fishSpot := ogl.getModels(3122259503);

  12. #112
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    But still, I don't know why I keep getting this access violation :S

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

    Default

    In computing, a segmentation fault (often shortened to segfault) or access violation is a fault raised by hardware with memory protection, notifying an operating system (OS) about a memory access violation; on x86 computers this is a form of general protection fault.

    An operating system, as defined by Google, is the software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

    If you're still confused, I saved you a further Google, and will define a peripheral device. A peripheral device is generally defined as any auxiliary device such as a computer mouse or keyboard, that connects to and works with the computer in some way. Other examples of peripherals are image scanners, tape drives, microphones, loudspeakers, webcams, and digital cameras.




    Skype: obscuritySRL@outlook.com

  14. #114
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Ahha.. ok. And now in English? Why does it give me the access violation error?

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

    Default

    Make sure your ogLib is updated to the latest version. An access violation is failure to access.

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

    Default

    An access violation is a broad error that can happen in many situations, you'll need to post the code that led to the error in order for us to best help you

    For instance, you may be trying to work with an empty array of models due to lack of length checking.

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

    Default

    Yush dragon are you still having problems?

    edit : removed something i originally posted, forgot something :P
    Last edited by Lucidity; 06-03-2015 at 10:35 AM.

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

    Default

    @Bly

    countDown.setTime(0) will reset a countDown.




    Skype: obscuritySRL@outlook.com

  19. #119
    Join Date
    Apr 2015
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    It's alternative to color, yes? Is it like Reflection in Simba style? How is it different from reflection, because I sure as hell I'm interested So hard for me to pick colors no matter CTS0/2, this is such a tempting perspective.

    I found out sometimes I have to restart the Simba client after running the ogLib script once, as I get Access Violation otherwise.

    Also, since it finds a model/texture, and clicks based on it, does similar TPA-randomized clicking occur? I saw randomizePointEllipse in Clarity's example script, does it function well enough, anti-ban-measure speaking?

    Also curious. If RS's NXT client get's developed, and perhaps OpenGL support get's dropped (will it?), this method could no longer be viable then?

    Other than that, looking forward to try it out. My color-finding is horrible.
    Would be nice if somebody could answer a few of my questions.

    Cheers and thanks a lot for good work!

    EDIT:
    I found out you can't have setDebugMode and ogl.getModels going on at the same time. Well, you can, but it's buggy, as in sometimes the setDebugMode blocks the getModels, and vice versa. Managed to workaround this by setDebugMode, wait(X), getmodels, wait(Y), until false.
    Last edited by Krzysztof; 06-04-2015 at 07:48 PM.

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

    Default

    If you get AV, hold F9.

    Anti-ban is up to the script writers to add. This includes randomizePoint*() which works great.

    NXT will drop DX and run on Open/webGL.

    setDebumode() should only be called once, soon after setup(). Even still, it shouldn't affect getModels().




    Skype: obscuritySRL@outlook.com

  21. #121
    Join Date
    Apr 2015
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    If you get AV, hold F9.

    Anti-ban is up to the script writers to add. This includes randomizePoint*() which works great.

    NXT will drop DX and run on Open/webGL.

    setDebumode() should only be called once, soon after setup(). Even still, it shouldn't affect getModels().
    Thanks for replying!
    setDebugMode certainly affected getModels. Couldn't get both of them to run, unless I did the mainloop with wait(X) periods between them, for some reason. I could've made a mistake, however.

    Will drop DX? I have a pretty old computer, DX works more smoothly, hitches less, and also the game looks quite better. How come it's the one that could get dropped? It's because of the cross-platform and progressively improving driver support?
    Last edited by Krzysztof; 06-05-2015 at 10:36 AM.

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

    Default

    OpenGL is cross-platform. DirectX is for Windows. One of the focuses of NXT is to make it cross platform.




    Skype: obscuritySRL@outlook.com

  23. #123
    Join Date
    Apr 2015
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Thanks for answering, Obscurity.

    Now, can somebody tell me what is wrong?

    That's the current script. It worked once already, and now for some reason I can't get it to work:
    Code:
    program ogLib;
    {$i ogLib\lib\core\core.simba}
    
    var
      clientCenter: TPoint;
    
    procedure mainLoop;
    var
      willowTrees: glModelArray;
      clickPoint:tPoint;
    begin
      willowTrees := ogl.getModels(892814592);
      clickPoint:= clientCenter.closest(willowTrees)[0].randomizePointEllipse(15);
      clearDebug;
      if willowTrees.isEmpty() then
          writeln('No trees were found.')
      else
          clickMouse(clickPoint.x, clickPoint.y, 1);
      wait(random(5000, 10000));
    end;
    
    begin
      ogl.setup();
      clientCenter := ogl.getClientMidPoint();
    //ogl.setDebugMode('models');
    
    repeat
    //  clearDebug();
      mainLoop;
    //  writeLn(ogl.getModels(897174394));
    //  wait(100000)
    until false;
    
    
    
    end.
    Because I'm not getting any compilling errors, however i do get this:
    Code:
    Error: Access violation at line 1369
    >>method.simba gets opened<<
    line 1369:     result:=[self.x+round((funcRadius:=funcDiameter div 2)*(funcRandom:=random())*cos(funcAngle:=random()*(pi*2))),self.y+round((funcRadius*funcRandom)*sin(funcAngle))];
    When I replaced randomizePointEllipse(15); with randomizePoint(36, 32)
    core.simba gets opened instead, and the error line is 779 because of
    Code:
    Error: "0.26179938779915" is an invalid float at line 779
    line 779:     oglAngleTolerance:=strToFloat(replaceRegExpr('^$',readINI('Default','oglAngleTolerance','includes/ogLib/lib/core/core.ini'),'0.26179938779914943653855361527335',false));
    Last edited by Krzysztof; 06-05-2015 at 04:12 PM.

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

    Default

    You should always do a length check (or .isEmpty()) before trying to access an index in a gl*Array, In case none are visible.

    In other words:
    if length(willowTrees) then
    ClickPoint:=...

    We also have mouse.click(tPoint). :-P.




    Skype: obscuritySRL@outlook.com

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

    Default

    Yeah, you're likely trying to work with arrays that have no contents, hence the access violation error. You will need to make sure you actually find things with the length check in order to proceed, else continue and skip.

Page 5 of 8 FirstFirst ... 34567 ... 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
  •