Quesooo Posted April 26, 2020 Posted April 26, 2020 (edited) How to make this script to automated event? - Event will run everyday 2x at 10:00 and 16:00 no need to whisper the NPC. here's the script thank you for those who help - script HHE -1,{ end; OnWhisperGlobal: if(getgmlevel()<.Access) end; if(@whispervar0$ == "Start"){ if(.Event == 1){ dispbottom "Event already started"; end; } else { dispbottom "Input New Base Rate"; input .@BaseExp; dispbottom "Input New Job Rate"; input .@JobExp; setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; dispbottom "Event has been started."; initnpctimer; set .Event,1; announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0; } end; } if(@whispervar0$ == "Stop"){ if(.Event == 1) goto L_STOP; else dispbottom "Event not started."; end; } end; OnInit: set .DefaultBaseRates,getbattleflag("base_exp_rate"); set .DefaultJobRates,getbattleflag("job_exp_rate"); set .Access,80; // GM access lvl end; OnTimer3600000: // After 1 hour L_STOP: set .Event,0; stopnpctimer; setbattleflag "base_exp_rate",.DefaultBaseRates; setbattleflag "job_exp_rate",.DefaultJobRates; announce "Happy Hour EXP: The floating rates event have been ended. Rates back to the normal.",0; end; } Edited April 26, 2020 by Quesooo Quote
0 Quesooo Posted April 30, 2020 Author Posted April 30, 2020 Anyone can give me a hint how to make this automated? Quote
0 Emistry Posted April 30, 2020 Posted April 30, 2020 - script HHE -1,{ OnInit: set .DefaultBaseRates,getbattleflag("base_exp_rate"); set .DefaultJobRates,getbattleflag("job_exp_rate"); set .Access,80; // GM access lvl OnTimer3600000: // After 1 hour OnStop: stopnpctimer; set .Event,0; callsub(L_Start, .DefaultBaseRates, .DefaultJobRates); end; OnClock1000: OnClock1600: callsub(L_Start, 2, 2); // 2x end; OnWhisperGlobal: if (getgmlevel() < .Access) end; if (@whispervar0$ == "Start") { if (.Event == 1) { dispbottom "Event already started"; } else { dispbottom "Input New Base Rate"; input .@BaseExp; dispbottom "Input New Job Rate"; input .@JobExp; callsub(L_Start, .@BaseExp, .@JobExp); } end; } else if (@whispervar0$ == "Stop") { if (.Event == 1) { donpcevent strnpcinfo(3)+"::OnStop"; } else dispbottom "Event not started."; end; } end; L_Start: .@BaseExp = getarg(0, 1); .@JobExp = getarg(0, 1); if (.@BaseExp < 1) .@BaseExp = 1; if (.@JobExp < 1) .@JobExp = 1; setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; dispbottom "Event has been started."; initnpctimer; set .Event,1; announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0; return; } try 1 Quote
0 Quesooo Posted April 30, 2020 Author Posted April 30, 2020 10 minutes ago, Emistry said: - script HHE -1,{ OnInit: set .DefaultBaseRates,getbattleflag("base_exp_rate"); set .DefaultJobRates,getbattleflag("job_exp_rate"); set .Access,80; // GM access lvl OnTimer3600000: // After 1 hour OnStop: stopnpctimer; set .Event,0; callsub(L_Start, .DefaultBaseRates, .DefaultJobRates); end; OnClock1000: OnClock1600: callsub(L_Start, 2, 2); // 2x end; OnWhisperGlobal: if (getgmlevel() < .Access) end; if (@whispervar0$ == "Start") { if (.Event == 1) { dispbottom "Event already started"; } else { dispbottom "Input New Base Rate"; input .@BaseExp; dispbottom "Input New Job Rate"; input .@JobExp; callsub(L_Start, .@BaseExp, .@JobExp); } end; } else if (@whispervar0$ == "Stop") { if (.Event == 1) { donpcevent strnpcinfo(3)+"::OnStop"; } else dispbottom "Event not started."; end; } end; L_Start: .@BaseExp = getarg(0, 1); .@JobExp = getarg(0, 1); if (.@BaseExp < 1) .@BaseExp = 1; if (.@JobExp < 1) .@JobExp = 1; setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; dispbottom "Event has been started."; initnpctimer; set .Event,1; announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0; return; } try Thank you @Emistry already tried the script but it seems like the rates going to increase more for example my default rates is x8x8 and when i load the npc it becomes x3000x3000 do i need to edit some line or i edit some line incorrectly? Base on my understanding this line should be change to what exp or job rates should be when the event starts setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; Quote
0 Emistry Posted April 30, 2020 Posted April 30, 2020 - script HHE -1,{ OnInit: set .DefaultBaseRates,getbattleflag("base_exp_rate"); set .DefaultJobRates,getbattleflag("job_exp_rate"); set .Access,80; // GM access lvl OnTimer3600000: // After 1 hour OnStop: stopnpctimer; set .Event,0; callsub(L_Start, .DefaultBaseRates, .DefaultJobRates); end; OnClock1000: OnClock1600: callsub(L_Start, (.DefaultBaseRates * 2), (.DefaultJobRates * 2)); // 2x end; OnWhisperGlobal: if (getgmlevel() < .Access) end; if (@whispervar0$ == "Start") { if (.Event == 1) { dispbottom "Event already started"; } else { dispbottom "Input New Base Rate"; input .@BaseExp; dispbottom "Input New Job Rate"; input .@JobExp; callsub(L_Start, .@BaseExp, .@JobExp); } end; } else if (@whispervar0$ == "Stop") { if (.Event == 1) { donpcevent strnpcinfo(3)+"::OnStop"; } else dispbottom "Event not started."; end; } end; L_Start: .@BaseExp = getarg(0, 1); .@JobExp = getarg(0, 1); if (.@BaseExp < 1) .@BaseExp = 1; if (.@JobExp < 1) .@JobExp = 1; setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; dispbottom "Event has been started."; initnpctimer; set .Event,1; announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+(.@BaseExp / 100)+"x, Job - "+(.@JobExp / 100)+"x",0; return; } Quote
0 Quesooo Posted April 30, 2020 Author Posted April 30, 2020 13 hours ago, Emistry said: - script HHE -1,{ OnInit: set .DefaultBaseRates,getbattleflag("base_exp_rate"); set .DefaultJobRates,getbattleflag("job_exp_rate"); set .Access,80; // GM access lvl OnTimer3600000: // After 1 hour OnStop: stopnpctimer; set .Event,0; callsub(L_Start, .DefaultBaseRates, .DefaultJobRates); end; OnClock1000: OnClock1600: callsub(L_Start, (.DefaultBaseRates * 2), (.DefaultJobRates * 2)); // 2x end; OnWhisperGlobal: if (getgmlevel() < .Access) end; if (@whispervar0$ == "Start") { if (.Event == 1) { dispbottom "Event already started"; } else { dispbottom "Input New Base Rate"; input .@BaseExp; dispbottom "Input New Job Rate"; input .@JobExp; callsub(L_Start, .@BaseExp, .@JobExp); } end; } else if (@whispervar0$ == "Stop") { if (.Event == 1) { donpcevent strnpcinfo(3)+"::OnStop"; } else dispbottom "Event not started."; end; } end; L_Start: .@BaseExp = getarg(0, 1); .@JobExp = getarg(0, 1); if (.@BaseExp < 1) .@BaseExp = 1; if (.@JobExp < 1) .@JobExp = 1; setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; dispbottom "Event has been started."; initnpctimer; set .Event,1; announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+(.@BaseExp / 100)+"x, Job - "+(.@JobExp / 100)+"x",0; return; } Still not working do i need to change some line or just use this script? Quote
Question
Quesooo
How to make this script to automated event?
- Event will run everyday 2x at 10:00 and 16:00
no need to whisper the NPC. here's the script
thank you for those who help
- script HHE -1,{ end; OnWhisperGlobal: if(getgmlevel()<.Access) end; if(@whispervar0$ == "Start"){ if(.Event == 1){ dispbottom "Event already started"; end; } else { dispbottom "Input New Base Rate"; input .@BaseExp; dispbottom "Input New Job Rate"; input .@JobExp; setbattleflag "base_exp_rate",.@BaseExp*100; setbattleflag "job_exp_rate",.@JobExp*100; dispbottom "Event has been started."; initnpctimer; set .Event,1; announce "Happy Hour EXP: Floating rates event started. New rates: Base - "+.@BaseExp+"x, Job - "+.@JobExp+"x",0; } end; } if(@whispervar0$ == "Stop"){ if(.Event == 1) goto L_STOP; else dispbottom "Event not started."; end; } end; OnInit: set .DefaultBaseRates,getbattleflag("base_exp_rate"); set .DefaultJobRates,getbattleflag("job_exp_rate"); set .Access,80; // GM access lvl end; OnTimer3600000: // After 1 hour L_STOP: set .Event,0; stopnpctimer; setbattleflag "base_exp_rate",.DefaultBaseRates; setbattleflag "job_exp_rate",.DefaultJobRates; announce "Happy Hour EXP: The floating rates event have been ended. Rates back to the normal.",0; end; }
5 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.