Jump to content
  • 0

REQ: Weekly Supply Giver Script


brizzle413

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   3
  • Joined:  09/06/12
  • Last Seen:  

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!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   3
  • Joined:  09/06/12
  • Last Seen:  

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!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   3
  • Joined:  09/06/12
  • Last Seen:  

Thanks Lovable, I will try this :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Thanks Lovable, I will try this :)

 

I'm not really Lovable. XD 

Link to comment
Share on other sites

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.

×
×
  • Create New...