Ingame remove item after 1hour

General Chat, Comments
Post Reply
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

Ingame remove item after 1hour

Post by KaL »

For Ingame "Object"

I created: "X" item

Condition: 1hr

Effect: remove item "X"

Will that removed the item "X" out of the player inventory or out of the
Object table after 1hour purchase by the player?
Zester
Posts: 53
Joined: Sat Mar 03, 2012 11:33 pm

Re: Ingame remove item after 1hour

Post by Zester »

create a PHP page with the code to remove items, then go to Cplanel or what ever you are using a set up a cron to run the PHP ever hour.
this will not work on windowz .


cheers
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Ingame remove item after 1hour

Post by hallsofvallhalla »

This is for the NWE engine. It is a feature he is asking about.
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

Re: Ingame remove item after 1hour

Post by KaL »

Yes! I'm talking about the feature about the engine inside the game. I don't want to build it again if it's already been made. Thanks halla
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Ingame remove item after 1hour

Post by KyleMassacre »

Hmmmm, interesting. I have actually not messed around with that so I wouldn't know but maybe ill do some testing and find out.
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: Ingame remove item after 1hour

Post by a_bertrand »

No the conditions and actions on the items are for when you wear them. For example, the condition can block somebody to wear a given item if he/she doesn't have the requirements to do so. The action will be triggered just after wearing it.

If you want to remove items after some time, you will need to implement a new module which checks it. You may either use a cron or something like the cron system of NWE which doesn't actually require a crontab to be set.
Creator of Dot World Maker
Mad programmer and annoying composer
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Ingame remove item after 1hour

Post by KyleMassacre »

Yeah that's what I'm thinking needs to be done is a cron. But also I think we should be able to do more with the wizards actions. For example it doesn't like me trying to set a user variable with some math and trying to chain the set with the get like:

Code: Select all

SetUserVariable(variable, GetUserVariable(variable)+86400);
 
Seems the table editor doesn't like it for some reason haha
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

Re: Ingame remove item after 1hour

Post by KaL »

Ok thanks guys!

Well I created a script for it. Just using - "date(d)-date(d)+1"
To get an increment of 1 - which 1 is an actual day in time. It works! Now I'm going to write
A module for it. LOL! Not bad for a beginner on php . Took me month to figure this out.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Ingame remove item after 1hour

Post by KyleMassacre »

KaL wrote:Ok thanks guys!

Well I created a script for it. Just using - "date(d)-date(d)+1"
To get an increment of 1 - which 1 is an actual day in time. It works! Now I'm going to write
A module for it. LOL! Not bad for a beginner on php . Took me month to figure this out.
To be honest and not know what your script looks like I don't think that will work right. lets look at some math here:
So we all know date('d') is the date so for S&Gs we'll call it 14 (print date('d');)
Now lets put it in plain text:
14-14+1= 1
http://codepad.org/QxnPL8Jt

Like I said I don't know what your code is but your logic may be off a bit so you may be deleting stuff that shouldn't be deleted or not deleting it when it should
Post Reply

Return to “General”