Jump to content
  • 0

Item Reward every 24 hrs and need to stay for 5 hours


jigsgfx

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

hi, just tried to search for script that gives item to a player same with Daily Reward the only thing is player needs to stay at least 5 hours to get the item reward on Item Reward NPC, once they get the reward and stayed longer than 5 hours and attempt to claim another reward they wont get it.. they can only received or get a reward again after 24 hours or more depends on the settings..

btw auto vending is not included to received or get a reward.

thanks in advanced to anyone who will make my request.. more power rathena ^^ /no1

Edited by jigsgfx
Link to comment
Share on other sites

25 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

This is a script that allows the player to obtain the set items if he/she plays at least 5 consecutive hours (No logout / char select). Post here if found some errors. Don't have time to test it.

http://pastebin.com/xqUHD4wn

Edited by Aya
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

thanks alot.. ill try this.. :D

btw how can i make this as NPC? and will said to player that he cant use it again, only after 24 hrs?

Edited by jigsgfx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

Hmm. That is basically what I am using. I don't know how to make it as an NPC but you can try this one for the script to become an NPC. I didn't test it but let's just try =)

http://pastebin.com/aPkGBHK7

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

where do you put this kind of script?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

you mean a place? like in prontera 154 123..

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try this...

http://pastebin.com/raw.php?i=ZN44Spcd


Hmm. That is basically what I am using. I don't know how to make it as an NPC but you can try this one for the script to become an NPC. I didn't test it but let's just try =)

http://pastebin.com/aPkGBHK7

script will keep giving away the item when users has online for every 5 hours.....

This is a script that allows the player to obtain the set items if he/she plays at least 5 consecutive hours (No logout / char select). Post here if found some errors. Don't have time to test it.

http://pastebin.com/xqUHD4wn

missing npc name...and can be abuse by keep clicking on the npc...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

Thanks Emistry ill try this out.. /no1

having an error

[Error]: npc_parse_script: Invalid placement format for a script in file 'scriptpath/5hrs-reward.txt', line '1'. Skipping the rest of file...
* w1=prontera,151,182
* w2=script
* w3=Sample
* w4=757,{

Edited by jigsgfx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Missing the <facing> value. Also, try to use tabulations and not returns between each part of the header.

prontera,151,182,4<TAB>script<TAB>Sample<TAB>757,{

Edited by Ryokem
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

i see thanks...

error again

[Error]:  Loading NPC file: scriptpath/5hrs-reward.txt
script error on scriptpath/5hrs-reward.txt line 13
   parse_simpleexpr: unexpected expr end
 8 :
 9 : OnUpdate:
   10 : if( !checkvending() ){
   11 :			    set @Hour,@Hour + 1;
   12 :			    if( @Hour % 5 == 0 && #Day != gettime(4) ){
*   13 :					    getitem','512,5;
   14 :					    set #Day,gettime(4);
   15 :					    dispbottom "Online 5 Hours continuously...gained			    1 item for today.";
   16 :			    }
   17 : }
   18 : OnPCLoginEvent:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

getitem,512,5; change to

getitem 512,5;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

its working now.. thanks btw one more thing

if( !checkvending() ){
 set @Hour,@Hour + 1;
 if( @Hour % 5 == 0 && #Day != gettime(4) ){
  getitem 7227,5;
  set #Day,gettime(4);
  dispbottom "Online 5 Hours continuously...gained 1 item for today.";
 }
}

the "@Hour % 5" the #5 red color if i set it to 1 it means they need to online for 1 hr ? coz when i test it it seems like only 5 minutes not 5 hours coz i got the item already im expecting to stay for 5 hours..

Edited by jigsgfx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

its working now.. thanks btw one more thing

if( !checkvending() ){
 set @Hour,@Hour + 1;
 if( @Hour % 5 == 0 && #Day != gettime(4) ){
  getitem 7227,5;
  set #Day,gettime(4);
  dispbottom "Online 5 Hours continuously...gained 1 item for today.";
 }
}

the "@Hour % 5" the #5 red color if i set it to 1 it means they need to online for 1 hr ?

Yeah. But then, set @Hour,@Hour + 1; becomes meaningless.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

when i test it it seems like only 5 minutes not 5 hours coz i got the item already im expecting to stay for 5 hours..

LOL...my bad...

addtimer 60000,strnpcinfo(0)+"::OnUpdate";

should be

addtimer 3600000,strnpcinfo(0)+"::OnUpdate";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

when i test it it seems like only 5 minutes not 5 hours coz i got the item already im expecting to stay for 5 hours..

LOL...my bad...

addtimer 60000,strnpcinfo(0)+"::OnUpdate";

should be

addtimer 3600000,strnpcinfo(0)+"::OnUpdate";

3600000 is = to 1 hour right? coz 5 hours is 18000000 in ms? or not?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

lazy to count it....make use of your calculator..../swt

or you can also write it like this..

addtimer ( 5 * 3600000 ),strnpcinfo(0)+"::OnUpdate";

or any equivalent method.....

but if based on the script....it should use 1 hours instead of 5 hours..

if you are going to use 5 hours...then you have to edit part of the script...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

There's master Emistry =)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

lazy to count it....make use of your calculator.... /swt

or you can also write it like this..

addtimer ( 5 * 3600000 ),strnpcinfo(0)+"::OnUpdate";

or any equivalent method.....

but if based on the script....it should use 1 hours instead of 5 hours..

if you are going to use 5 hours...then you have to edit part of the script...

btw this script will be useless once the player is disconnected or character select right? is there a way to compensate time once they got disconnected? like if a player disconnected and back online again script will count 4 hours instead of 5 hrs? just asking if its possible its ok if not :D

thanks Master Emistry and who ever can help me out..

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

just edit the variable..

@Hour

to

Hour	   <--------- Character Based
#Hour	 <--------- Account Based

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

thanks dude.. /no1

if i choose #Hour it means? beside that its account based

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

hi, just want to ask again if is there's something wrong with my script please take a look coz my players said that they dont receive any item..

here's the code



turbo_room,89,99,4 script Active Rewarder 757,{
if( #Day == gettime(4) ){
mes "You have claimed the item for today. try again tomorrow.";
}else{
mes "Please online 5 hours continuously to get 15x TCG....";
}
close;

OnUpdate:
if( !checkvending() ){
set #Hour,#Hour + 1;
if( #Hour % 5 == 0 && #Day != gettime(4) ){
getitem 7227,15;
set #Day,gettime(4);
dispbottom "Online 5 Hours continuously...gained 15x TCG for today.";
}
}
OnPCLoginEvent:
if( #Day != gettime(4) ) addtimer ( 5 * 3600000 ),strnpcinfo(0)+"::OnUpdate";
end;
}

thanks again in advance /no1

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

if( #Day != gettime(4) ) addtimer ( 5 * 3600000 ),strnpcinfo(0)+"::OnUpdate";

the timer run 5 hours then only it will trigger the check.....

and then you update a variable every 5 hours.....and the variable have to update 5 time before a player can get reward...

overall....your player have to online for a total of 25 hours before he can get any rewards....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

try this:

replace:

if( #Day != gettime(4) ) addtimer ( 5 * 3600000 ),strnpcinfo(0)+"::OnUpdate";

with this:

if( #Day != gettime(4) ) addtimer ( 3600000 ),strnpcinfo(0)+"::OnUpdate";

Edited by stydianx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

it means

try this:

replace:

if( #Day != gettime(4) ) addtimer ( 5 * 3600000 ),strnpcinfo(0)+"::OnUpdate";

with this:

if( #Day != gettime(4) ) addtimer ( 3600000 ),strnpcinfo(0)+"::OnUpdate";

does it means that players needs to be online for 5 hours in total per day ??

and if ever i want to reduce time like make it 2hrs or 3hrs where can i change that?

Edited by jigsgfx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

the one in the bottom is already set to 5 hours..

and yes, it is possible for you to change the time..

if you want it to be in 2 hours, calculate how many ms there is in 1 sec.

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