ToiletMaster Posted April 29, 2013 Group: Members Topic Count: 76 Topics Per Day: 0.02 Content Count: 276 Reputation: 7 Joined: 08/11/12 Last Seen: January 26, 2018 Share Posted April 29, 2013 (edited) Hi Guys, Currently i have a small request for a script to be made. Example would be there is an npc that gives you an apple which will be refreshed every 15 minutes, it will also display how long before the next apple is possible to gain. Within that 15 minutes, the npc will just be saying to wait till 15 minutes from where the last apple was taken. Additional Info ------------------- Apple was taken at 17:03 minutes, next apple can only be taken at 17:18 minutes. regardless of who the player is. Hope it's enough information. Edited April 29, 2013 by ToiletMaster Quote Link to comment Share on other sites More sharing options...
-SkittleNugget- Posted April 29, 2013 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 318 Reputation: 54 Joined: 12/23/12 Last Seen: July 1, 2017 Share Posted April 29, 2013 (edited) there is no line to display the time left to the user, try if ($@time < gettimetick(2)) { mes "You are able to take an apple"; close2; set $@time, gettimetick(2) + 900; // 15 Minutes getitem "Apple",1; end; } Mes "Please wait " + (($@time - gettimetick(2)) / 60 ) + " Minutes before getting another apple"; close; I wrote this on my phone -> Bad format ? Edited April 29, 2013 by Metamorphic 1 Quote Link to comment Share on other sites More sharing options...
kadze Posted April 29, 2013 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 58 Reputation: 5 Joined: 12/12/11 Last Seen: March 10, 2024 Share Posted April 29, 2013 (edited) if (time>gettimetick(2)) { mes "You take your apple"; close; } set time, gettimetick ( 2 ) + 900; getitem apple,1; Edited April 29, 2013 by kadze Quote Link to comment Share on other sites More sharing options...
ToiletMaster Posted April 29, 2013 Group: Members Topic Count: 76 Topics Per Day: 0.02 Content Count: 276 Reputation: 7 Joined: 08/11/12 Last Seen: January 26, 2018 Author Share Posted April 29, 2013 if (time>gettimetick(2)) { mes "You take your apple"; close; } set time, gettimetick ( 2 ) + 900; getitem apple,1; Doesn't work, it only displays you take your apple that's all. doesn't go anything further than that. Quote Link to comment Share on other sites More sharing options...
kadze Posted April 29, 2013 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 58 Reputation: 5 Joined: 12/12/11 Last Seen: March 10, 2024 Share Posted April 29, 2013 it does not display the timer, but gives an apple every 15 minutes Quote Link to comment Share on other sites More sharing options...
Reynard Posted April 29, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 56 Reputation: 9 Joined: 09/22/12 Last Seen: August 16, 2020 Share Posted April 29, 2013 close2; instead of close;Remember, close; teminates the script execution, means everything below close; wont happen. Quote Link to comment Share on other sites More sharing options...
ToiletMaster Posted April 29, 2013 Group: Members Topic Count: 76 Topics Per Day: 0.02 Content Count: 276 Reputation: 7 Joined: 08/11/12 Last Seen: January 26, 2018 Author Share Posted April 29, 2013 Not sure is it me but i've tried close2 yet it doesn't seem to work the way i wanted to, it doesn't give any apples at all Quote Link to comment Share on other sites More sharing options...
kadze Posted April 29, 2013 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 58 Reputation: 5 Joined: 12/12/11 Last Seen: March 10, 2024 Share Posted April 29, 2013 close2; instead of close; Remember, close; teminates the script execution, means everything below close; wont happen. close2? why? he gets an apple every 15 minutes, why make another one? Quote Link to comment Share on other sites More sharing options...
Reynard Posted April 29, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 56 Reputation: 9 Joined: 09/22/12 Last Seen: August 16, 2020 Share Posted April 29, 2013 close2? why? he gets an apple every 15 minutes, why make another one? *close; This command will create a 'close' button in the message window for the invoking character. If no window is currently on screen, the script execution will end. This is one of the ways to end a speech from an NPC. Once the button is clicked, the NPC script execution will end, and the message box will disappear. mes "[Woman]"; mes "I am finished talking to you. Click the close button."; close; mes "This command will not run at all, since the script has ended."; --------------------------------------- *close2; This command will create a 'close' button in the message window for the invoking character. WARNING: If no window is currently on screen, the script execution will halt indefinitely! See 'close'. There is one important difference, though - even though the message box will have closed, the script execution will not stop, and commands after 'close2' will still run, meaning an 'end' has to be used to stop the script, unless you make it stop in some other manner. mes "[Woman]"; mes "I will warp you now."; close2; warp "place",50,50; end; Don't expect things to run smoothly if you don't make your scripts 'end'. Quote Link to comment Share on other sites More sharing options...
-SkittleNugget- Posted April 29, 2013 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 318 Reputation: 54 Joined: 12/23/12 Last Seen: July 1, 2017 Share Posted April 29, 2013 (edited) Reason to use Close2; We want to allow the user to use the close button while the script still runs.. Using Close2; in the script before mine would have not worked, Only in the way I have done it. Edited April 29, 2013 by Metamorphic Quote Link to comment Share on other sites More sharing options...
ToiletMaster Posted May 1, 2013 Group: Members Topic Count: 76 Topics Per Day: 0.02 Content Count: 276 Reputation: 7 Joined: 08/11/12 Last Seen: January 26, 2018 Author Share Posted May 1, 2013 there is no line to display the time left to the user, try if ($@time < gettimetick(2)) { mes "You are able to take an apple"; close2; set $@time, gettimetick(2) + 900; // 15 Minutes getitem "Apple",1; end; } Mes "Please wait " + (($@time - gettimetick(2)) / 60 ) + " Minutes before getting another apple"; close; I wrote this on my phone -> Bad format ? Aside from the missing brackets, This works great! exactly what i required! Thanks alot! Works flawlessly! Quote Link to comment Share on other sites More sharing options...
Question
ToiletMaster
Hi Guys,
Currently i have a small request for a script to be made.
Example would be there is an npc that gives you an apple which will be refreshed every 15 minutes,
it will also display how long before the next apple is possible to gain. Within that 15 minutes, the npc will just be saying to wait till
15 minutes from where the last apple was taken.
Hope it's enough information.
Edited by ToiletMasterLink to comment
Share on other sites
10 answers to this question
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.