Jump to content

Utility: Daily Rewards Giver


sandbox

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

File Name: Daily Rewards Giver

File Submitter: sandbox

File Submitted: 24 Feb 2014

File Category: Utilities

Content Author: sandbox


This script will hand out rewards to your player accounts once upon login, and can be dynamic depending on how you configure it. And when a player logs 5x consecutively, s/he will receive all the prizes from day 1 to 5.

Example based on Day

  1. Red Potion (1pc.)
  2. Orange Potion (2pcs.)
  3. Yellow Potion (3pcs.)
  4. Yggdrasil Berry (2pcs.)
  5. Yggdrasil Seed (1pc.) + 1 Red Potion, 2 Orange Potion, 3 Yellow Potion, 2 Yggdrasil Berry


Terms & Conditions

  • You are not allowed to reproduce or make profit of this script
  • You are not allowed to take credit for this script. Though you can modify/edit it to your liking.
  • I can give you support, but please, do not message me.



Click here to download this file

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

i got this error when login to test the daily D:

xlu9lJ4.png

 

ingame

g4dk70i.png

0 null

 

DD:

 

the script D:

//======Name========================================
// Daily Login Rewards
//======Version=====================================
// 1.0
// Author: Sandbox
//======Comments====================================
// 
//==================================================

-	script	DailyLoginRewards	-1,{


setarray .@D_Prize[0],673,675,671,12103; //Set to desired item prizes
setarray .@D_Amt[0],100,50,10,1; //Amount of prize to be given
set .@Serv_Name$,"Tairyu Ro"; //Set to your server name


OnPCLoginEvent:

	if(gettimetick(2) > #ClaimDelay) {
		if(gettimetick(2) > #StreakDelay) set #LogStreak,0;
		
		if(#RewardStreak == 0) {
			dispbottom "Bienvenido/a a "+.@Serv_Name$+"! Recibiste "+.@D_Amt[#RewardStreak]+" "+getitemname(.@D_Prize[#RewardStreak])+" por jugar! Entra a jugar diario para recibir regalos como estos! Si te conectas 5 dias consecutivos, recibiras premios extra!";
		}

		else {
			dispbottom "Bienvenido/a a "+.@Serv_Name$+"! Recibiste "+.@D_Amt[#RewardStreak]+" "+getitemname(.@D_Prize[#RewardStreak])+" por conectarte! Conectate diario para recibir premios! Cuando te conectes 5 dias consecutivos, recibiras premios extra!";
		}

		getitem .@D_prize[#RewardStreak],.@D_Amt[#RewardStreak];
		set #RewardStreak,#RewardStreak+1;
		set #LogStreak,#LogStreak+1;
		set #ClaimDelay,gettimetick(2)+86400;
		set #StreakDelay,gettimetick(2)+172800;

		if(#LogStreak >= 4) {
			for( set .@i, 0; .@i < 4; set .@i, .@i +1 ) {
				getitem .@D_prize[.@i],.@D_Amt[.@i];
			}
			dispbottom "Felicidades!! por conectarse 5 dias consecutivos recibiste varios premios!";
			set #LogStreak,0;
		}

	}
end;
}

i just translated it to spanish D: also changed some ids

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Well, the script never use the variable for the reward, set the variable after onpcloginevent

OnPCLogin....
    setarray .@D_Prize[0],673,675,671,12103; //Set to desired item prizes
    setarray .@D_Amt[0],100,50,10,1; //Amount of prize to be given
    set .@Serv_Name$,"Tairyu Ro"; //Set to your server name

 

EDIT : Code seems to be broken ??

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Well, the script never use the variable for the reward, set the variable after onpcloginevent

OnPCLogin....

    setarray .@D_Prize[0],673,675,671,12103; //Set to desired item prizes

    setarray .@D_Amt[0],100,50,10,1; //Amount of prize to be given

    set .@Serv_Name$,"Tairyu Ro"; //Set to your server name

 

EDIT : Code seems to be broken ??

 

hello o: ty for tha repply capuche o:!! huh dunno if it's broken D:!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

Echoing @Capuche, the script is not loading the temporary NPC variables upon login. Here are two different ways to resolve the issue:

  1. Move the OnPCLoginEvent label on line 18 to line 12.
  2. Place an OnInit label on line 12 and an end; on line 16. Then, change all instances of .@D_Prize.@D_Amt, and .@Serv_Name$ to .D_Prize.D_Amt, and .Serv_Name$, respectively.
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

o: i will pick number 1, seems easy (?) thanks o: donna edit when done testing o:!

 

same result with # 1

 

well maybe because i need to @reloadscript or restart (?) because i just did @loadnpc trunk/place/rewardfile.txt D:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

Sorry! I haven't tested this script after modifying it into a new one.. Will update it.. Apologies for the errors

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

na don't worry, i will patiently wait o;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

I've fixed it, just follow what Capuche/Missingno did, can't download it yet since uploading a new version would make it unapproved again ;(

Edited by sandbox
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

I've fixed it, just follow what Capuche/Missingno did, can't download it yet since uploading a new version would make it unapproved again ;(

 

i did what they say but that not worked D: i just did @loadnpc and not worked then @reloadscript and didn't work so i guess i will need to restart the server

just waiting for the ppl to go to sleep lol

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

i did what they say but that not worked D: i just did @loadnpc and not worked then @reloadscript and didn't work so i guess i will need to restart the server

just waiting for the ppl to go to sleep lol

 

Did you unload the previous version prior to loading the new one? And you really shouldn't use @reloadscript on a live server. o_O

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

 

i did what they say but that not worked D: i just did @loadnpc and not worked then @reloadscript and didn't work so i guess i will need to restart the server

just waiting for the ppl to go to sleep lol

 

Did you unload the previous version prior to loading the new one? And you really shouldn't use @reloadscript on a live server. o_O

 

 

unloadnpc npcname yeah D:

i do reloadscript on the mornings when every single player is sleeping xD z_z 

 

or i shut it down and then turn it on to live test and see errors on the emulator D:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

unloadnpc npcname yeah D:

i do reloadscript on the mornings when every single player is sleeping xD z_z 

 

or i shut it down and then turn it on to live test and see errors on the emulator D:

 

Are you testing on your GM or with a test account? If you're using your GM or an account that has already received a reward, you won't be able to adequately test until the delay has passed for that account.

 

Honestly, you shouldn't use @reloadscript at all; you'd be better off restarting your server, and even then you shouldn't need to for simply swapping out your NPCs.

 

If you can't see console errors, you should probably be running your server in screen; if you're getting socket errors after running your server in screen, check if other processes are already using those ports (like a second instance of rAthena) and kill them.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

 

unloadnpc npcname yeah D:

i do reloadscript on the mornings when every single player is sleeping xD z_z 

 

or i shut it down and then turn it on to live test and see errors on the emulator D:

 

Are you testing on your GM or with a test account? If you're using your GM or an account that has already received a reward, you won't be able to adequately test until the delay has passed for that account.

 

Honestly, you shouldn't use @reloadscript at all; you'd be better off restarting your server, and even then you shouldn't need to for simply swapping out your NPCs.

 

If you can't see console errors, you should probably be running your server in screen; if you're getting socket errors after running your server in screen, check if other processes are already using those ports (like a second instance of rAthena) and kill them.

 

 

 

aaah thank you o:

 

allright i will take more care of my npcs and server and try to don't use reloadscript at all

 

thanks for the links too o:! going to check o:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

@reloadscript is really not recommended since it also respawns monsters.. You should @unloadnpc it first BEFORE you execute @loadnpc restarting your server is your 2nd option and @reloadscript should be last resort.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

@reloadscript is really not recommended since it also respawns monsters.. You should @unloadnpc it first BEFORE you execute @loadnpc restarting your server is your 2nd option and @reloadscript should be last resort.

 

yeah i know D: that's why i do reloadscript just when there are no players, when they sleep, around 2~4am no one connects

i did the unload and then the load npc 

well np at all im right now having problems with my server so i alrwady did a lot of shutdowns and turns on x_x

 

thankie o:!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

Well, did it work out fine already?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Well, did it work out fine already?

 

i cant see right now, im having problems, give me a while and i will tell you o:

 

offtopic: problems with my server x_x

see general support

 

Edit:

it works :D!

//======Name========================================
// Daily Login Rewards
//======Version=====================================
// 1.0
// Author: Sandbox
//======Comments====================================
// 
//==================================================

-	script	DailyLoginRewards	-1,{

OnPCLoginEvent:

setarray .@D_Prize[0],673,675,671,12103; //Set to desired item prizes
setarray .@D_Amt[0],100,50,10,1; //Amount of prize to be given
set .@Serv_Name$,"Tairyu Ro"; //Set to your server name



	if(gettimetick(2) > #ClaimDelay) {
		if(gettimetick(2) > #StreakDelay) set #LogStreak,0;
		
		if(#RewardStreak == 0) {
			dispbottom "Bienvenido/a a "+.@Serv_Name$+"! Recibiste "+.@D_Amt[#RewardStreak]+" "+getitemname(.@D_Prize[#RewardStreak])+" por jugar! Entra a jugar diario para recibir regalos como estos! Si te conectas 5 dias consecutivos, recibiras premios extra!";
		}

		else {
			dispbottom "Bienvenido/a a "+.@Serv_Name$+"! Recibiste "+.@D_Amt[#RewardStreak]+" "+getitemname(.@D_Prize[#RewardStreak])+" por conectarte! Conectate diario para recibir premios! Cuando te conectes 5 dias consecutivos, recibiras premios extra!";
		}

		getitem .@D_prize[#RewardStreak],.@D_Amt[#RewardStreak];
		set #RewardStreak,#RewardStreak+1;
		set #LogStreak,#LogStreak+1;
		set #ClaimDelay,gettimetick(2)+86400;
		set #StreakDelay,gettimetick(2)+172800;

		if(#LogStreak >= 4) {
			for( set .@i, 0; .@i < 4; set .@i, .@i +1 ) {
				getitem .@D_prize[.@i],.@D_Amt[.@i];
			}
			dispbottom "Felicidades!! por conectarse 5 dias consecutivos recibiste varios premios!";
			set #LogStreak,0;
		}

	}
end;
}

that how is working now o;

  • Upvote 1
Link to comment
Share on other sites

  • 4 years later...

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  70
  • Reputation:   0
  • Joined:  06/19/18
  • Last Seen:  

Hi! How to increase the daily login from 5 to 7?

 

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
Reply to this topic...

×   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...