brizzle413 Posted October 11, 2015 Posted October 11, 2015 Hi Folks, Can someone please create a script for me. This is how it should work: 1. It should be automated every Friday at 12:00 hours 2. The Script should distribute supply boxes to all accounts (even OFFLINE players) 3. There should be a pop up message that weekly supply has been granted. That's the function i am looking for. I hope someone can create one for me. Thanks in advance! Quote
Azura Skyy Posted October 11, 2015 Posted October 11, 2015 Try this out Credits to Capuche. This is just a slightly modified version of their script. prontera,155,170,5 script add storage 139,{ OnFri1200: // online do { set .@size, query_sql( "SELECT `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ ( .@loop *128 ) +", 128", .@account_id ); for( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) { getitem 512, 1, .@account_id[.@i];//Set item ID,Quantity message rid2name( .@account_id[.@i] ), "^00CCFFYou've received an Apple.^000000"; } set .@loop, .@loop +1; } while( .@size ); // offline query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select '0', '#item_inventory_gift', '"+ .@item_id +"', '2', `char`.`account_id` "+ "from `char` where `char`.`online` = '0' on duplicate key update `global_reg_value`.`value` = '"+ .@item_id +"'"; close; end; OnPCLoginEvent: if( #item_inventory_gift ) { getitem #item_inventory_gift, 1; message strcharinfo(0), "^00CCFFYou've received an Apple.^000000"; set #item_inventory_gift, 0; } end; } Hope this helps, ~Azura Skyy Quote
brizzle413 Posted October 11, 2015 Author Posted October 11, 2015 Thanks so much for quick reply. I will try this now Hi Lore, The script is working brilliantly. Only thing is that offline players do not get the item when they login. Is it possible to edit? Thanks again! Quote
Ninja Posted October 12, 2015 Posted October 12, 2015 (edited) How about using the mail function? OnFri1200: query_sql ("INSERT INTO `mail` (`send_name`, `send_id`, `dest_name`, `dest_id`, `title`, `message`, `status`, `zeny`, `nameid`, `amount`) VALUES ("AN AWESOME GUY", 0, "A NEWB", 150001, "SOMETHING FOR YOU", "ENJOY", 1000, 607, 5)); end; Edited October 12, 2015 by jezznar Quote
brizzle413 Posted October 13, 2015 Author Posted October 13, 2015 Thanks Lovable, I will try this Quote
Ninja Posted October 13, 2015 Posted October 13, 2015 Thanks Lovable, I will try this I'm not really Lovable. XD Quote
Question
brizzle413
Hi Folks,
Can someone please create a script for me.
This is how it should work:
1. It should be automated every Friday at 12:00 hours
2. The Script should distribute supply boxes to all accounts (even OFFLINE players)
3. There should be a pop up message that weekly supply has been granted.
That's the function i am looking for.
I hope someone can create one for me.
Thanks in advance!
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.