Jump to content
  • 0

REQ: Weekly Supply Giver Script


Question

Posted

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

Posted

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

Posted

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!

Posted (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 by jezznar

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...