zein Posted January 16, 2013 Posted January 16, 2013 (edited) How to change the dynamic time? I want to make the script run minimum every 1 hours + randomly minute. //http://rathena.org/board/topic/53877-lucky-pick-event/ //emistry script - script AutoFunEvent -1,{ OnInit: OnClock0000: set .LuckyTime,rand(24); OnMinute60: if( gettime(3) == .LuckyTime ){ set .DelayMin,rand(60); sleep ( .DelayMin * 60000 ); while(1){ query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid; attachrid .@aid; if( CheckVending() ){ DetachRID(); continue; } announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "you got 500 cash point"; break; } } end; } Thanks Edited January 17, 2013 by zenz90 Quote
1 AnnieRuru Posted January 17, 2013 Posted January 17, 2013 this script sux big time use mine http://rathena.org/board/topic/72927-the-prize-is-not-given-to-players/#entry149317 update this script - script AutoFunEvent -1,{ OnInit: while (1) { freeloop 1; .@rand = rand(2000000000); .@count = 0; while ( getusers(1) > .@count ) { .@nb = query_sql("select account_id from `char` where online = 1 order by rand("+ .@rand +") limit 128 offset "+ .@count, .@aid ); .@i = 0; while ( .@i < .@nb ) { if ( attachrid(.@aid[.@i]) ) { if ( getgmlevel() < 60 && !checkvending() ) { // only normal players and non-vending players announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00; #cashpoints = #cashpoints + 500; dispbottom "you got 500 cash point"; break; } } .@i++; } if ( .@i < .@nb ) break; .@count += 128; } freeloop 0; sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hour } end; } 1 Quote
0 kalabasa Posted December 23, 2019 Posted December 23, 2019 Sorry for a noob question i search everywhere about this script and i found out only modifications i tried the original link but not found by emistry i know how to put NPC's but this is an automated event and npc is not needed (i dont know im still new here)so how can i run/execute this? where to put? thank you Quote
0 Skorm Posted December 28, 2019 Posted December 28, 2019 On 12/23/2019 at 1:58 AM, kalabasa said: Sorry for a noob question i search everywhere about this script and i found out only modifications i tried the original link but not found by emistry i know how to put NPC's but this is an automated event and npc is not needed (i dont know im still new here)so how can i run/execute this? where to put? thank you Just load it like you would any other NPC. Also you shouldn't necro really old topics like this there is more than enough information out there about loading in NPCs. Quote
0 kalabasa Posted December 29, 2019 Posted December 29, 2019 On 12/28/2019 at 12:02 PM, Skorm said: Just load it like you would any other NPC. Also you shouldn't necro really old topics like this there is more than enough information out there about loading in NPCs. i am sorry for you thinking that way i was currently getting useful scripts here to be tested soon and im still new in here sorry again for misunderstood Quote
0 BeWan Posted December 29, 2019 Posted December 29, 2019 2 hours ago, kalabasa said: i am sorry for you thinking that way i was currently getting useful scripts here to be tested soon and im still new in here sorry again for misunderstood here edit onlock and onminute prontera,150,150,4 script Event 998,{ OnInit: OnClock0000: set .LuckyTime,rand(24); OnMinute60: if( gettime(3) == .LuckyTime ){ set .DelayMin,rand(60); sleep ( .DelayMin * 60000 ); while(1){ query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid; attachrid .@aid; if( CheckVending() ){ DetachRID(); continue; } announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "you got 500 cash point"; break; } } end; } Quote
zein Posted January 17, 2013 Author Posted January 17, 2013 (edited) Thanks for reply Emistry ! so the script edited like this ? //http://rathena.org/board/topic/53877-lucky-pick-event/ //emistry script - script AutoFunEvent -1,{ OnInit: OnClock0000: set .LuckyTime,rand(24); OnMinute00: if( gettime(3) == .LuckyTime ){ set .DelayMin,rand(60); sleep ( rand(60) * 1000 ); while(1){ query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid; attachrid .@aid; if( CheckVending() ){ DetachRID(); continue; } announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "you got 500 cash point"; break; } } end; } Edited January 17, 2013 by zenz90 Quote
Capuche Posted January 17, 2013 Posted January 17, 2013 Yes it is. btw you can remove set .DelayMin,rand(60); Quote
zein Posted January 19, 2013 Author Posted January 19, 2013 @AnnieRuru is that script works on 3CeAM ? btw thanks for reply Quote
Capuche Posted January 19, 2013 Posted January 19, 2013 (edited) @AnnieRuru is that script works on 3CeAM ? btw thanks for reply * Imitate the voice of AnnieRuru * No it doesn't ! (lol) It works only on rAthena Edited January 19, 2013 by Capuche 1 Quote
jigsgfx Posted January 23, 2013 Posted January 23, 2013 (edited) Hi, how can we change this into items instead of cashpoints? thanks Edited January 23, 2013 by jigsgfx Quote
Emistry Posted January 23, 2013 Posted January 23, 2013 change set #CASHPOINTS,#CASHPOINTS+500; to getitem 512,1000; refer getitem or getitem2 Quote
jigsgfx Posted January 23, 2013 Posted January 23, 2013 (edited) change set #CASHPOINTS,#CASHPOINTS+500; to getitem 512,1000; refer getitem or getitem2 thanks emistry how about the one Annie did? ill change this #cashpoints = #cashpoints + 500; to this getitem 512,1000; ?? and can i use 2 same lucky pick script at the same time with different item reward set on it? also does afk players are excluded meaning afk dont have a chance to pick by the script and get rewards? Edited January 23, 2013 by jigsgfx Quote
zein Posted February 2, 2013 Author Posted February 2, 2013 @Emistry The dynamic time doesn't work, it still run every 12-24 hour I want make it to one hour + randomly minute. any suggestion? Thanks, //http://rathena.org/board/topic/53877-lucky-pick-event/ //emistry script - script AutoFunEvent -1,{ OnInit: OnClock0000: set .LuckyTime,rand(24); OnMinute00: if( gettime(3) == .LuckyTime ){ set .DelayMin,rand(60); sleep ( rand(60) * 1000 ); while(1){ query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid; attachrid .@aid; if( CheckVending() ){ DetachRID(); continue; } announce strcharinfo(0) +" won 500 cash in Lucky Pick Event ", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "You got 500 cash point"; break; } } end; } Quote
Emistry Posted February 3, 2013 Posted February 3, 2013 remove these if you want it to work every hours. OnInit: OnClock0000: set .LuckyTime,rand(24); ........................ if( gettime(3) == .LuckyTime ){ Quote
AnnieRuru Posted February 3, 2013 Posted February 3, 2013 sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hour I thought mine already comply your request ? Quote
Meister Posted March 20, 2013 Posted March 20, 2013 sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hourI thought mine already comply your request ? If I want it to be every 6 hours do I need to multiply 3600000 to 6 ? and remove + rand(3600000) ? Thanks! Quote
Skorm Posted March 20, 2013 Posted March 20, 2013 Yes sleep 3600000 * 6; // 1 Hour in Milliseconds * 621600000 / 1000 = 21600 //seconds 21600 / 60 = 360 //Minutes 360 / 60 = 6 //Hours Quote
Question
zein
How to change the dynamic time?
I want to make the script run minimum every 1 hours + randomly minute.
Thanks
Edited by zenz9019 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.