sandbox Posted February 24, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 949 Reputation: 174 Joined: 06/12/12 Last Seen: Friday at 12:25 PM Share Posted February 24, 2014 File Name: Daily Rewards Giver File Submitter: sandbox File Submitted: 24 Feb 2014 File Category: Utilities Content Author: sandboxThis 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 Red Potion (1pc.) Orange Potion (2pcs.) Yellow Potion (3pcs.) Yggdrasil Berry (2pcs.) 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 Quote Link to comment Share on other sites More sharing options...
Kido Posted February 25, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 25, 2014 i got this error when login to test the daily D: ingame 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 Quote Link to comment Share on other sites More sharing options...
Capuche Posted February 25, 2014 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 February 25, 2014 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 ?? 1 Quote Link to comment Share on other sites More sharing options...
Kido Posted February 25, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 25, 2014 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:! Quote Link to comment Share on other sites More sharing options...
Missingno Posted February 25, 2014 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 135 Reputation: 41 Joined: 02/05/14 Last Seen: December 23, 2022 Share Posted February 25, 2014 Echoing @Capuche, the script is not loading the temporary NPC variables upon login. Here are two different ways to resolve the issue: Move the OnPCLoginEvent label on line 18 to line 12. 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. 1 Quote Link to comment Share on other sites More sharing options...
Kido Posted February 25, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 25, 2014 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: Quote Link to comment Share on other sites More sharing options...
sandbox Posted February 26, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 949 Reputation: 174 Joined: 06/12/12 Last Seen: Friday at 12:25 PM Author Share Posted February 26, 2014 Sorry! I haven't tested this script after modifying it into a new one.. Will update it.. Apologies for the errors Quote Link to comment Share on other sites More sharing options...
Kido Posted February 26, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 26, 2014 na don't worry, i will patiently wait o; Quote Link to comment Share on other sites More sharing options...
sandbox Posted February 26, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 949 Reputation: 174 Joined: 06/12/12 Last Seen: Friday at 12:25 PM Author Share Posted February 26, 2014 (edited) 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 February 26, 2014 by sandbox Quote Link to comment Share on other sites More sharing options...
Kido Posted February 26, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 26, 2014 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 Quote Link to comment Share on other sites More sharing options...
Missingno Posted February 26, 2014 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 135 Reputation: 41 Joined: 02/05/14 Last Seen: December 23, 2022 Share Posted February 26, 2014 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 Quote Link to comment Share on other sites More sharing options...
Kido Posted February 26, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 26, 2014 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: Quote Link to comment Share on other sites More sharing options...
Missingno Posted February 26, 2014 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 135 Reputation: 41 Joined: 02/05/14 Last Seen: December 23, 2022 Share Posted February 26, 2014 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. Quote Link to comment Share on other sites More sharing options...
Kido Posted February 26, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 26, 2014 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: Quote Link to comment Share on other sites More sharing options...
sandbox Posted February 27, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 949 Reputation: 174 Joined: 06/12/12 Last Seen: Friday at 12:25 PM Author Share Posted February 27, 2014 @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. Quote Link to comment Share on other sites More sharing options...
Kido Posted February 27, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 27, 2014 @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:! Quote Link to comment Share on other sites More sharing options...
sandbox Posted February 27, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 949 Reputation: 174 Joined: 06/12/12 Last Seen: Friday at 12:25 PM Author Share Posted February 27, 2014 Well, did it work out fine already? Quote Link to comment Share on other sites More sharing options...
Kido Posted February 27, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted February 27, 2014 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 ! //======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; 1 Quote Link to comment Share on other sites More sharing options...
Psy Ops Posted November 4, 2018 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 70 Reputation: 0 Joined: 06/19/18 Last Seen: January 24, 2023 Share Posted November 4, 2018 Hi! How to increase the daily login from 5 to 7? Quote Link to comment Share on other sites More sharing options...
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.