zein Posted January 16, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 34 Reputation: 4 Joined: 03/16/12 Last Seen: November 10, 2013 Share 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 Link to comment Share on other sites More sharing options...
1 AnnieRuru Posted January 17, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
0 kalabasa Posted December 23, 2019 Group: Members Topic Count: 123 Topics Per Day: 0.05 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Share 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 Link to comment Share on other sites More sharing options...
0 Skorm Posted December 28, 2019 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: Sunday at 10:43 PM Share 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 Link to comment Share on other sites More sharing options...
0 kalabasa Posted December 29, 2019 Group: Members Topic Count: 123 Topics Per Day: 0.05 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Share 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 Link to comment Share on other sites More sharing options...
0 BeWan Posted December 29, 2019 Group: Members Topic Count: 20 Topics Per Day: 0.01 Content Count: 403 Reputation: 249 Joined: 07/04/19 Last Seen: Saturday at 04:58 AM Share 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 Link to comment Share on other sites More sharing options...
Currently Posted January 16, 2013 Group: Members Topic Count: 162 Topics Per Day: 0.03 Content Count: 313 Reputation: 1 Joined: 01/22/12 Last Seen: November 17, 2023 Share Posted January 16, 2013 Also need this (: Quote Link to comment Share on other sites More sharing options...
Emistry Posted January 16, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 20 hours ago Share Posted January 16, 2013 OnMinute00: sleep ( rand(60) * 1000 ); Quote Link to comment Share on other sites More sharing options...
zein Posted January 17, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 34 Reputation: 4 Joined: 03/16/12 Last Seen: November 10, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted January 17, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 17, 2013 Yes it is. btw you can remove set .DelayMin,rand(60); Quote Link to comment Share on other sites More sharing options...
zein Posted January 19, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 34 Reputation: 4 Joined: 03/16/12 Last Seen: November 10, 2013 Author Share Posted January 19, 2013 @AnnieRuru is that script works on 3CeAM ? btw thanks for reply Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 19, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
jigsgfx Posted January 23, 2013 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 83 Reputation: 0 Joined: 06/02/12 Last Seen: June 11, 2018 Share Posted January 23, 2013 (edited) Hi, how can we change this into items instead of cashpoints? thanks Edited January 23, 2013 by jigsgfx Quote Link to comment Share on other sites More sharing options...
Emistry Posted January 23, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 20 hours ago Share Posted January 23, 2013 change set #CASHPOINTS,#CASHPOINTS+500; to getitem 512,1000; refer getitem or getitem2 Quote Link to comment Share on other sites More sharing options...
jigsgfx Posted January 23, 2013 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 83 Reputation: 0 Joined: 06/02/12 Last Seen: June 11, 2018 Share 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 Link to comment Share on other sites More sharing options...
zein Posted February 2, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 34 Reputation: 4 Joined: 03/16/12 Last Seen: November 10, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
Emistry Posted February 3, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 20 hours ago Share 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 Link to comment Share on other sites More sharing options...
AnnieRuru Posted February 3, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted February 3, 2013 sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hour I thought mine already comply your request ? Quote Link to comment Share on other sites More sharing options...
Meister Posted March 20, 2013 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 841 Reputation: 17 Joined: 04/16/12 Last Seen: March 4, 2024 Share 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 Link to comment Share on other sites More sharing options...
Skorm Posted March 20, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: Sunday at 10:43 PM Share 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 Link to comment Share on other sites More sharing options...
Question
zein
How to change the dynamic time?
I want to make the script run minimum every 1 hours + randomly minute.
Thanks
Edited by zenz90Link to comment
Share on other sites
19 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.