-
Posts
205 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Posts posted by Ryokem
-
-
Then you can't run any sql commands. lol.
-
atoi is the worst command to be used unless it's really necessary.
Your script is good, but just use gettime() or similar.
-
@Annie:
Try never to use continue; script function. It's odd and pretty bad. I believe it works exactly as in C or C++, and that command was used to refresh the heap scrolling it from start to end, just to say "let the script continue", and that is actually pretty useless, it just helps to slow down the compiler.
not that a friend of mine was even Fired from his ex agency for using it into a serial script... odd but true D:
@Key:
Is really rA system so bad that never implemented an enumeration? ._.
Well, I could expect it from something it doesn't even have floats xD
-
This gives .item_amount of .item_id each new day they log in. If you want to manage offline players too, you need to use some sql queries, but I don't really like that way to get free items if not playing
OnPCLoginEvent: if( (obbDay == gettime(5)) && (obbMonth == gettime(6)) ) end; set obbMonth, gettime(6); set obbDay, gettime(5); getitem .item_id, .item_amount; dispbottom "You have been rewarded with " + .item_amount + " " + getitemname(.item_id); end; OnInit: set .item_id, <obb id>; set .item_amount, <amount>; }
-
Just add all possible bet-combinantion into different arrays, means the "red", "black", "close-to-0", "column 1-2-3", "even", "odd" and so on.
Then, make an array that store every single bet of each player, and a parallel two other arrays which store the name of the player who did that bet and the bet amount.
Then, for every bet, check if the corrispondent array contains the winning number, if so, reward the player.
Delete all arrays in the end, and start back again.
-
Try to avoid to use atcommand in scripts, unless you have to.
atcommand "@broadcast "+strcharinfo(0);You can easily replace this atcommand with some script commands.
Try to check it on wiki: Announce
- 1
-
getmapusers("guild_vs2")+"/100]"";
Typo-e I believe (see red quote
setarray .@Display$,"Room #1 ["+getmapusers("pvp_n_2-3")+"/100]","Room #2 ["+getmapusers("guild_vs2")+"/100]";
- 1
-
Are you using an SQL emulator? xD
-
Oh god no quit that goto please! xD
-
Npc variables are not a waste of "server resources" at all. The while() loop is a waste when it does nothing, that's for sure, but i was just editing the script depending on what he needed trying to leave his script untouched if possible. I just gave a brief explanation on how to do it in a general case, not on how to optimize a full script.
-
Of course it talks the random messages.
Disable the npc means that players CANNOT interact with it in any way, but all the other script triggers (event labels) still works.
As the npctalk and the npcwalkto are called through the event label OnInit, it will keep doing it.
You will have to set a variable to record if the npc is disabled or not.
OnSun0000: OnTue0000: enablenpc strnpcinfo(0); .is_enable = 1; end; OnMon0000: OnWed0000: disblenpc strnpcinfo(0); .is_enable = 0; end;
while (1) { sleep .@interval * 1000; if( .is_enable ) { getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "Heloo!!!", // 1 "Goodbye~!" // 2 ); } }
-
prontera,97,153,5 script Clemy 703,{ mes "If you can speak with me, I'm enabled!!!"; close; //I've used On<weekdays><hour><minute>: event label. //Weekdays are Sun,Mon,Tue,Wed,Thu,Fri,Sat. //Days you want to ENABLE the NPC (NPC will last enabled until next disable) OnSun0000: OnTue0000: enablenpc strnpcinfo(0); end; //Days you want to DISABLE the NPC (NPC will last disabled until next enable) OnMon0000: OnWed0000: disblenpc strnpcinfo(0); end; OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "Heloo!!!", // 1 "Goodbye~!" // 2 ); } }
-
-
whoaa too many of them. btw thanks a lot for the announcer.. 2 thumps up =) i'll try each of them
OnMinute00: OnMinute30: if( .rand ) .index = rand(getarraysize(.announce$)); else .index = (.index+1) % getarraysize(.announce$); announce .announce$[.index], 0; end; OnInit: setarray .announce$, "Sentence 1", "Sentence 2", "Sentence 3", // Add as many as you wish "Sentence N"; .rand = 1; //Set 1 if you want random sentence each time, 0 if you want to announce it consecutively. end;
have parse line problem in line 29.....
There's not even Line 29 O.o Tell me what line and which error.
-
set .Announcements$[0],"GameMasters will never ask for your account information.", "Broadcast Two", "Broadcast Three"; //etc.. set .colour$[0],"0xFF0000",//red "0x00FF00", //Green "0x0000FF"; //blue
Those are multiple values settings, so you must use Setarray
-
OnMinute00: OnMinute30: if( .rand ) .index = rand(getarraysize(.announce$)); else .index = (.index+1) % getarraysize(.announce$); announce .announce$[.index], 0; end; OnInit: setarray .announce$, "Sentence 1", "Sentence 2", "Sentence 3", // Add as many as you wish "Sentence N"; .rand = 1; //Set 1 if you want random sentence each time, 0 if you want to announce it consecutively. end;
-
I just tested -- enablenpc works from a disabled npc!
lol it works
I think it was fixed in 2010 or something ... so yeah disablenpc doesn't work like this 3 years ago, but now can
Disablenpc just let users not to be able to run it, but you can still call his script with Event Labels or other NPC functions. So of course you can enable itself if he's disabled
-
Try to check the wiki page about the Guildchangegm command, there's a fully example about how to do it: Guildchangegm
About he 2 conditions, just add an if statement for every of them:
• 1m per Change Guild Leader
if( Zeny < 1000000 ) { mes "not Enough Zeny"; close; } //Paying... set Zeny, Zeny - 1000000;
• Cannot change Guild Leader during WOE
if( agitcheck() ) { mes "You can't change the GM while WoE is active! Come back later."; close; }
-
I'm up for this section as well, if necessary.
-
6 thousand lines
I wish I can have so much time to spare to read up the script lol.
-
Hello and thank you for all your help.
The NPC now counts down, but only 60 and downwards. If there's longer than 60 seconds left, it'll just keep looking 60 seconds each minute.
Yeah, you have to put some brackets.
dispbottom "Please wait for "+ .@m +" min(s) "+ ( (.@s) ? .@s +" seconds" : "");
Hmm, i never would have though of using ' set ' in an ( if ) statement.. didn't think the system could proccess that lol. *Keeps an eye on you* I'm looking forward to seeing other things you'll do lol.
Do not forget that all commands are monitored by a source function, and regardless from what they do, they always have some values as return, most of them are booleans (true, false), another good part is integers or float/double (not in e/rAthena case as those kind of variables are not really implemented).
-
maybe (saying maybe cause I really don't know about that) when you invoke the getexp command, it just takes the already multiplied exp from the monsterinfo, and then multiply back again due to the quest_exp_rate, that's why it increases this much. You can try to do some tests setting (for example) 1 as poring's base exp, and checking what kind of moltiplications the server compute.
EDIT:
hahaha!
EDIT: Damn, 3 people at once XDEDIT: <3 u Annie xD -
Note that 'getexp' is now subject to the 'quest_exp_rate' config option, which
adjusts the gained value. If you want to bypass this, use the 'set' method.
Maybe you can try with the set method...
set BaseExp, BaseExp + getmonsterinfo(killedrid,3); set JobExp, JobExp + getmonsterinfo(killedrid,4);
EDIT: <3 u Annie xD
-
I'm sure you can read the source file ... no need me to explain ...
somehow I feel like you love to attack my post because I have no programming background
Nah, I don't have any purpose on "attacking" you or your posts. Do you think I really have any interest about showing my abilities this way? I would have way better things to do xD. Just I feel that you are pretty nice a cooperative girl, and your help is good for a nice community, so matching with you and the others is (in my opinion) always a good way for both sides (so me as well) to improve their knowledges or to learn something new. Also 'cause even if my knowledges about Programming are quite good, rAthena is still a new world for me, and facing people who knows it can help me to understand the whole rA background system. So don't feel like I'm attacking anyone xD *pokes Annie and hugs her kindly*
Koe script_rid2sd
in Scripting Support
Posted · Edited by Ryokem
Oh god, tons of useless if() and switch() statements that slow down everything
Example:
Can easily scripted like...
,
or even
The problem actually stands here:
As you can see, he's calling the KoEActualEnd label from an OnMinute event label, so into a script that has NO rid attached.
Checking that label...
You can easily notice that there is no commands that attach a RID to the script, and a getcharid() is called, commands that NEEDS a RID attached to work.
Key-kun's solution actually solve the problem, but I don't really know if it makes the script work as it should (didn't read all the other things, too lazy to read a script that would need 1/5 lines to work the same )