Jump to content
RealModScene
DannyBoy

Can a Fake Date option be added to DashLaunch?

Recommended Posts

Yeah, for some wierd reason the setDate and settime are in the kernel library, but the getdate and gettime are in the aurora library, so I didnt see it at first glance. 

 

You just have to write a script that would save the date and time to an ini file, then reload that date and time on run, and add like an hour to it. Since the clock is set in a military time setting, if time goes past 23:59:59 then the day would need to be updated by 1 day. you would also have to do the math on the days of the month. if you dont have the script handle these things, it might try to write invalid dates or times, and that would cause the script to error. so basically

if hour > 23 && minute > 59 && second > 59 then day = day + 1 

That line is wrong, but I think it sort of gets the point across.

you will also need to write a clause that handles the date, as if the day goes past 28 in february, and it isnt a leap year it might cause issues, and if there are only 30 days in a month, and you try to set it to 31, it could also cause issues. so you will have to handle that all in script. you can find example scripts here and the API here: https://github.com/XboxUnity/AuroraScripts/  you will also want to save the current time and date to an ini file, so you can increase the date/time with every boot, or it will always set it to the same value, which wont help either.

once you get the script written, add a require("Scriptpath") to the main.lua in the data/scripts/content folder of aurora. it will run the script everytime aurora loads.

I will not write this script for you. I could, but I think it is a waste of my time, as I can see no use for it in a mainstream sense. 

error 404 on that link bro.. gotta remove the / at the end lol

 

EDIT: nvm there was an extra space lol

Share this post


Link to post
Share on other sites

probably not going to happen, but you might be able to do it with aurora and utility scripts, in a future version, if you request that a setdate(), and settime() functions are added. I would not expect it to happen anytime soon though.

They're already there:

bool Kernel.SetDate(unsigned Year, unsigned Month, unsigned Day);

bool Kernel.SetTime(unsigned Hour, [unsigned Minute, unsigned Second, unsigned Millisecond]);

Share this post


Link to post
Share on other sites

So the console knows how long it was off, so the script can simply set the date?
I think you are missing the main point why you still need internet connection and why you would need a battery otherwise.

You can still write an autostart script that asks you every boot time what time it is and the user sets the time. I am waiting for the possibility to write autostartscripts without manipulating the main.lua of Aurora. It should be something official or at least conventional, so the next update or other scripts wont break it.

Maybe an update through the Auror Repo Browser which creates autostartscript.lua or directory and patches main.lua to include those, so scripters would put their scripts into the directory or apply an autostart script installer which registers the main.lua of the specific utility script.

Then i would go for it.

(I would be annoyed but looks like some people need this. I still prefer to have internet connection, to unleash the power of Aurora/Unity :D)

Share this post


Link to post
Share on other sites

They're already there:

bool Kernel.SetDate(unsigned Year, unsigned Month, unsigned Day);

bool Kernel.SetTime(unsigned Hour, [unsigned Minute, unsigned Second, unsigned Millisecond]);

I saw that after I posted that. lol. I was looking under the wrong library, as there is an Aurora.GetDate() and Aurora.GetTime(). lol.

Share this post


Link to post
Share on other sites

Yeah, for some wierd reason the setDate and settime are in the kernel library, but the getdate and gettime are in the aurora library, so I didnt see it at first glance. 

 

You just have to write a script that would save the date and time to an ini file, then reload that date and time on run, and add like an hour to it. Since the clock is set in a military time setting, if time goes past 23:59:59 then the day would need to be updated by 1 day. you would also have to do the math on the days of the month. if you dont have the script handle these things, it might try to write invalid dates or times, and that would cause the script to error. so basically

if hour > 23 && minute > 59 && second > 59 then day = day + 1 

That line is wrong, but I think it sort of gets the point across.

you will also need to write a clause that handles the date, as if the day goes past 28 in february, and it isnt a leap year it might cause issues, and if there are only 30 days in a month, and you try to set it to 31, it could also cause issues. so you will have to handle that all in script. you can find example scripts here and the API here: https://github.com/XboxUnity/AuroraScripts  you will also want to save the current time and date to an ini file, so you can increase the date/time with every boot, or it will always set it to the same value, which wont help either.

once you get the script written, add a require("Scriptpath") to the main.lua in the data/scripts/content folder of aurora. it will run the script everytime aurora loads.

I will not write this script for you. I could, but I think it is a waste of my time, as I can see no use for it in a mainstream sense. 

 

 

What programming language would I have to learn to be able to program this script. I don't really have programming experience but can maybe learn some basics. There is a purpose even though the time will not be current it will keep time moving forward from 12:00 AM on 11/22/2015 instead of going backwards and messing up saves order.

If I can't, I may just have leave my suggestion here for the Dashlaunch Dev, after all this the forum he mentioned in the readme to leave suggestions for him/her.

 

PS. I have switched to Aurora, will see how I like it by using it for a bit.

Share this post


Link to post
Share on other sites

What programming language would I have to learn to be able to program this script. I don't really have programming experience but can maybe learn some basics. There is a purpose even though the time will not be current it will keep time moving forward from 12:00 AM on 11/22/2015 instead of going backwards and messing up saves order.

If I can't, I may just have leave my suggestion here for the Dashlaunch Dev, after all this the forum he mentioned in the readme to leave suggestions for him/her.

 

PS. I have switched to Aurora, will see how I like it by using it for a bit.

lua scripting language mate.. there are alot of tuts on the web..

 

edit: lua scripting isnt all "that" hard.. i mean.. but yeah.. you could write a script.. that sets the date.. but it wouldnt be "exact" nor "cumulative" lol..

Share this post


Link to post
Share on other sites

I can probably work that out for you in the next week or so, if you really dont want to learn LUA, but that being the case, if I do it, I dont think it is fair that you come back asking for more, as half the fun of utility scripts is learning the basics of programming, as this script shouldnt be that hard.

  • Like 1

Share this post


Link to post
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.

Loading...

×
×
  • Create New...