I have an array that will most likely exceed 128 variables (account AID's / getcharid(3) ), so I decided to go with a setd based on what I've been told that it can hold far more and blah blah blah. Problem is that it doesn't seem to act like an array and the documentation for it, just doesn't describe it well enough for me. Here is what I have so far, 2 variations. Top is for adding them to array and bottom is for removing them from it. Neither work but I've substituted them back and forth for making them add to the array. There is nothing ever in the $Events array either.
for(set .@i,0; .@i < GetArraySize(getd("$Events")); set .@i,.@i+1){
if(getd("$Events"+"["+.@i+"]")!=getcharid(3)){
setd("$Events"),getcharid(3);
close2;
dispbottom "You have been added to Event queue!";
end;
}
for(set .@i,0; .@i < GetArraySize(getd($Events)); set .@i,.@i+1){
if($Events[.@i]==getcharid(3)){
deletearray getd($Events[.@i]),1;
close2;
dispbottom "You have been removed from Event queue!";
end;
Basically what happens is when I use the 1st one, it breaks out of the for() and continues on to give me my debug error message. Looking over various other setd/getd scripts, it shows the array in "" so I attempted that as well as the scope variable.. The 2nd one tends to give me an error with illegal scope and please report this. However, my test server is 14921 eAthena, I'm assuming that it's already been addressed (haven't set up a rAthena one yet to test that theory). Am I just using the commands wrong or?
I would much rather use 1 long array instead of having to break it up into if getsizeofarray 1 =128, add AID to array 2 and so on, then cycle through all of those arrays.
Edited by Arcenciel Please use a [Code] next time.
Question
Erebus
I have an array that will most likely exceed 128 variables (account AID's / getcharid(3) ), so I decided to go with a setd based on what I've been told that it can hold far more and blah blah blah. Problem is that it doesn't seem to act like an array and the documentation for it, just doesn't describe it well enough for me. Here is what I have so far, 2 variations. Top is for adding them to array and bottom is for removing them from it. Neither work but I've substituted them back and forth for making them add to the array. There is nothing ever in the $Events array either.
Basically what happens is when I use the 1st one, it breaks out of the for() and continues on to give me my debug error message. Looking over various other setd/getd scripts, it shows the array in "" so I attempted that as well as the scope variable.. The 2nd one tends to give me an error with illegal scope and please report this. However, my test server is 14921 eAthena, I'm assuming that it's already been addressed (haven't set up a rAthena one yet to test that theory). Am I just using the commands wrong or?
I would much rather use 1 long array instead of having to break it up into if getsizeofarray 1 =128, add AID to array 2 and so on, then cycle through all of those arrays.
Edited by ArcencielPlease use a [Code] next time.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.