View previous topic :: View next topic |
Author |
Message |
Twistedfate Expert Cheater Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Sun Jan 29, 2017 5:22 pm Post subject: Trainer deactivated on Date |
|
|
Is that possible to make the trainer deactivated on specific date ?
- I want the trainer read the date from internet then deactivaed if above or equal .
- ex : If the date above 30/1/2017 then close CE
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Jan 29, 2017 5:50 pm Post subject: |
|
|
Code: | local url = "http://free.timeanddate.com/clock/i5khbhkc/tt1/tw0/tm3/td2"
local http = getInternet()
local response = http.getURL(url)
http.destroy()
local month, day, year = response:match("<span id=t1>(.-)/(.-)/(.-)</span>")
local now = os.time({year=tonumber(year),month=tonumber(month),day=tonumber(day)})
local max = os.time({year=2017,month=1,day=28})
if now > max then
closeCE()
end |
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Jan 29, 2017 6:43 pm Post subject: |
|
|
By my experienced, sometimes, user change their computer date to manipulating os.time() and by pass time trial period given.
Code: | --- My old script for TIME TRIAL TRAINER to avoid user change their os.time() to bypass trial
--- Set Time Trial
--- Define your time trial period ----
--- Example for 3 days, start from 26/07/2016 and will end at 31/07/2016
UDF1.hide()
------------------------------- Define time trial variables
time_start = 1469509200 ---- EPOCH Number for date 26/07/2016
time_end = 1469941200 ---- EPOCH Number for data 31/07/2016
time_trial_check=tonumber(os.time()) ---- Convert user computer date to number
------------------------------- Below this line is a function to check valid dates
if time_trial_check < time_start or time_trial_check > time_end then
------------------------------- Show a message if time trial was ended. Or do something
showMessage("Sorry, Trial Over. Contact WHITE HOUSE or FBI")
return
closeCE()
else
------------------------------- If time trial period is valid then show trainer or do something
UDF1.show()
end |
|
|
Back to top |
|
|
dario3star Newbie cheater Reputation: 0
Joined: 14 Dec 2020 Posts: 23
|
Posted: Sat Dec 26, 2020 12:16 pm Post subject: |
|
|
Zanzer wrote: | Code: | local url = "xxxx//free.timexxxxxcom/clock/i5khbhkc/tt1/tw0/tm3/td2"
local http = getInternet()
local response = http.getURL(url)
http.destroy()
local month, day, year = response:match("<span id=t1>(.-)/(.-)/(.-)</span>")
local now = os.time({year=tonumber(year),month=tonumber(month),day=tonumber(day)})
local max = os.time({year=2017,month=1,day=28})
if now > max then
closeCE()
end |
|
This actually worked, i tested it on my pc. But the problem is when i disconnect my internet. This picture below shows the error and obviously showing that the code is running on lua (in the second error below), how to remove the error message? and show my custom text error message when/while i disconnect my internet. Thanks.
Description: |
|
Filesize: |
63.1 KB |
Viewed: |
2500 Time(s) |
|
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Sat Dec 26, 2020 1:58 pm Post subject: |
|
|
Add after
Code: | local response = http.getURL(url) |
this script
Code: | if (response == nil) then
showMessage('Internet connection is required!');
-- return closeCE() -- closes cheat engine;
end |
_________________
|
|
Back to top |
|
|
dario3star Newbie cheater Reputation: 0
Joined: 14 Dec 2020 Posts: 23
|
Posted: Sat Dec 26, 2020 8:37 pm Post subject: |
|
|
DaSpamer wrote: | Add after
Code: | local response = http.getURL(url) |
this script
Code: | if (response == nil) then
showMessage('Internet connection is required!');
-- return closeCE() -- closes cheat engine;
end |
|
Thanks! This worked too, the error message hides the real error. Thumbs up!
|
|
Back to top |
|
|
|