Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-29-2011, 11:45 PM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
I don't even know why you're looping it strangely in the first place, but you wrote temp.i < thiso.rights.size() instead of temp.i <= thiso.rights.size()? You'd be excluding one less array item.

In general though, there really isn't anything to 'fix' persay if we don't even know how you store your array vars (this.orights? too vague) or what you're really trying to do. Apparently you want to change the array with '[' or / yet nothing is indicating any keypresses besides onKeyPressed() which you didn't utilize properly anyway. Wat?

I guess you want to increment your array [] selectors, so why not just increment temp.i and de-increment them on '[' & / keypresses?
__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???
Reply With Quote
  #2  
Old 08-30-2011, 12:05 AM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
Quote:
Originally Posted by gaben View Post
I don't even know why you're looping it strangely in the first place, but you wrote temp.i < thiso.rights.size() instead of temp.i <= thiso.rights.size()? You'd be excluding one less array item.
No, although his script doesn't require a loop, he is looping it correctly. In arrays, the first element's index is 0, and the last element's index is array.size() - 1.
Reply With Quote
  #3  
Old 08-30-2011, 12:24 AM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
Quote:
Originally Posted by 0PiX0 View Post
No, although his script doesn't require a loop, he is looping it correctly. In arrays, the first element's index is 0, and the last element's index is array.size() - 1.
I didn't say he was looping it incorrectly, I just said it was rather strange compared to what he wanted to accomplish.

Anyway, it'd be much easier to just increment like this and perform some checks for this.i or whatever number he'll be using for the array [0] selector.

PHP Code:
//#CLIENTSIDE

function onCreated(){
  
this.0;
}

function 
onKeyPressed(codekey){
  if(
key == "[" && this.>= && this.3){
         
this.i++; // increment
         
player.chat this.i// print out for verification
  
}
  else if(
key == "/" && this.0){ // don't decrement 0 to -1!
        
this.i--;
        
player.chat this.i;
  }

Then I guess you'd do something like: thiso.rights[this.i] (selectors, 0,1,2,3).
__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???

Last edited by gaben; 08-30-2011 at 01:03 AM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.