Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Trainer control+VIP reg..+Time limit+Google Spreadsheets

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sun Sep 10, 2023 6:53 am    Post subject: Trainer control+VIP reg..+Time limit+Google Spreadsheets This post has 1 review(s) Reply with quote

Hello again..
I had a saying for Google Sheets.
I tested its feasibility and I'm publishing the result.

( The first version is available at this link and in Google Docs.
https://forum.cheatengine.org/viewtopic.php?t=613418 )

What's in this version:
1) Used Google Sheets instead of Google Docs.
2) "Version" option for trainer limitation.
3) User registration or usage restriction.
4) Set start and end time for user.

(And of course heed this warning from @atom0s.
https://forum.cheatengine.org/viewtopic.php?p=5758266#5758266
Besides, All these steps are options available after complex protection. )

Before moving on to the code, review some exceptions and create your own table according to this pattern.



1) The first line (1A-1B-1C-1D) should always be reserved for Trainer information.
In order: Trainer name (1A), Trainer version (1B), Admin (1C) and the site link to reach the Admin (1D).

2) All other lines are reserved for user information.
The record order should be as follows:
Username (column A), User ID (column B), Start Date (column C) and End Date (column D) for limited use

Just follow this format for writing History:
09/09/2023--22:50:10
(Day/Month/Year--Hour:Minute:Second)

Note: I recommend you choose the date and time differences according to your country.
The example country used in the Trainer is the Netherlands (ID: 4Cool, and you must take your own country ID number from the table below and write it in the relevant section of the code.
Code:
Country={{113,"Afghanistan - Kabul"},{284,"Albania - Tirana"},{14,"Algeria - Algiers"},{686,"Andorra - Andorra La Vella"},{138,"Angola - Luanda"},{688,"Antigua and Barbuda - Saint John's"},{51,"Argentina - Buenos Aires"},{485,"Argentina - Córdoba - Córdoba"},{370,"Armenia - Yerevan"},{57,"Australia - Australian Capital Territory - Canberra"},{240,"Australia - New South Wales - Sydney"},{929,"Australia - Northern Territory - Alice Springs"},{72,"Australia - Northern Territory - Darwin"},{47,"Australia - Queensland - Brisbane"},{927,"Australia - Queensland - Cairns"},{5,"Australia - South Australia - Adelaide"},{396,"Australia - Tasmania - Hobart"},{152,"Australia - Victoria - Melbourne"},{1980,"Australia - Western Australia - Eucla"},{196,"Australia - Western Australia - Perth"},{259,"Austria - Vienna - Vienna"},{369,"Azerbaijan - Baku"},{173,"Bahamas - Nassau"},{15,"Bahrain - Manama"},{73,"Bangladesh - Dhaka"},{46,"Barbados - Bridgetown"},{285,"Belarus - Minsk"},{48,"Belgium - Brussels - Brussels"},{36,"Belize - Belmopan"},{203,"Benin - Porto Novo"},{38,"Bermuda - Hamilton"},{690,"Bhutan - Thimphu"},{124,"Bolivia - La Paz"},{1888,"Bolivia - Sucre"},{691,"Bosnia-Herzegovina - Sarajevo"},{86,"Botswana - Gaborone"},{752,"Brazil - Acre - Rio Branco"},{144,"Brazil - Amazonas - Manaus"},{222,"Brazil - Bahia - Salvador"},{491,"Brazil - Ceará - Fortaleza"},{45,"Brazil - Distrito Federal - Brasilia"},{446,"Brazil - Pará - Belém"},{209,"Brazil - Pernambuco - Recife"},{213,"Brazil - Rio de Janeiro - Rio de Janeiro"},{233,"Brazil - São Paulo - São Paulo"},{932,"British Indian Ocean Territory - Diego Garcia"},{693,"Brunei - Bandar Seri Begawan"},{238,"Bulgaria - Sofia"},{186,"Burkina Faso - Ouagadougou"},{52,"Burundi - Bujumbura"},{3446,"Burundi - Gitega"},{685,"Cabo Verde - Praia"},{199,"Cambodia - Phnom Penh"},{267,"Cameroon - Yaoundé"},{55,"Canada - Alberta - Calgary"},{80,"Canada - Alberta - Edmonton"},{256,"Canada - British Columbia - Vancouver"},{265,"Canada - Manitoba - Winnipeg"},{749,"Canada - New Brunswick - Saint John"},{1137,"Canada - Newfoundland and Labrador - Happy Valley-Goose Bay"},{4880,"Canada - Newfoundland and Labrador - Mary's Harbour"},{175,"Canada - Newfoundland and Labrador - St. John's"},{1145,"Canada - Northwest Territories - Inuvik"},{678,"Canada - Northwest Territories - Yellowknife"},{286,"Canada - Nova Scotia - Halifax"},{3368,"Canada - Nunavut - Alert"},{1157,"Canada - Nunavut - Baker Lake"},{1160,"Canada - Nunavut - Coral Harbour"},{3764,"Canada - Nunavut - Eureka"},{3801,"Canada - Nunavut - Grise Fiord"},{1164,"Canada - Nunavut - Pond Inlet"},{2380,"Canada - Nunavut - Resolute Bay"},{188,"Canada - Ontario - Ottawa"},{250,"Canada - Ontario - Toronto"},{1922,"Canada - Quebec - Blanc-Sablon"},{2438,"Canada - Quebec - Chibougamau"},{3768,"Canada - Quebec - Kuujjuaq"},{165,"Canada - Quebec - Montréal"},{189,"Canada - Quebec - Québec"},{210,"Canada - Saskatchewan - Regina"},{679,"Canada - Yukon - Whitehorse"},{377,"Cayman Islands - George Town"},{694,"Central African Republic - Bangui"},{174,"Chad - N'Djamena"},{914,"Chile - Easter Island"},{574,"Chile - Punta Arenas"},{232,"Chile - Santiago"},{33,"China - Beijing Municipality - Beijing"},{470,"China - Chongqing Municipality - Chongqing"},{1232,"China - Guangdong - Shenzhen"},{2148,"China - Jiangsu - Suzhou"},{237,"China - Shanghai Municipality - Shanghai"},{918,"China - Tibet - Lhasa"},{655,"China - Xinjiang - Ürümqi"},{41,"Colombia - Bogota"},{696,"Comoros - Moroni"},{926,"Congo - Brazzaville"},{121,"Congo Dem. Rep. - Kinshasa"},{139,"Congo Dem. Rep. - Lubumbashi"},{279,"Cook Islands - Rarotonga"},{225,"Costa Rica - San Jose"},{1,"Cote d'Ivoire (Ivory Coast) - Abidjan"},{935,"Cote d'Ivoire (Ivory Coast) - Yamoussoukro"},{281,"Croatia - Zagreb"},{99,"Cuba - Havana"},{680,"Cyprus - Nicosia"},{204,"Czechia - Prague"},{69,"Denmark - Copenhagen"},{697,"Djibouti - Djibouti"},{698,"Dominica - Roseau"},{230,"Dominican Republic - Santo Domingo"},{915,"Ecuador - Galapagos Islands"},{93,"Ecuador - Guayaquil"},{190,"Ecuador - Quito"},{53,"Egypt - Cairo"},{228,"El Salvador - San Salvador"},{699,"Equatorial Guinea - Malabo"},{700,"Eritrea - Asmara"},{242,"Estonia - Tallinn"},{149,"Eswatini - Mbabane"},{7,"Ethiopia - Addis Ababa"},{630,"Falkland Islands - Stanley"},{701,"Faroe Islands - Tórshavn"},{82,"Fiji - Suva"},{101,"Finland - Helsinki"},{3718,"Finland - Kemi"},{1401,"Finland - Rovaniemi"},{195,"France - Île-de-France - Paris"},{61,"French Guiana - Cayenne"},{278,"French Polynesia - Tahiti - Papeete"},{3658,"French Southern Territories - Amsterdam Island"},{397,"French Southern Territories - Port-aux-Francais"},{129,"Gabon - Libreville"},{30,"Gambia - Banjul"},{371,"Georgia - Tbilisi"},{37,"Germany - Berlin - Berlin"},{83,"Germany - Hesse - Frankfurt"},{4,"Ghana - Accra"},{89,"Gibraltar - Gibraltar"},{26,"Greece - Athens"},{2114,"Greenland - Danmarkshavn"},{705,"Greenland - Ittoqqortoormiit"},{4217,"Greenland - Kangerlussuaq"},{703,"Greenland - Nuuk"},{3724,"Greenland - Qaanaaq"},{704,"Greenland - Thule Air Base"},{706,"Grenada - Saint George's"},{707,"Guadeloupe - Basse-Terre"},{91,"Guam - Hagåtña"},{94,"Guatemala - Guatemala City"},{67,"Guinea - Conakry"},{40,"Guinea-Bissau - Bissau"},{88,"Guyana - Georgetown"},{709,"Haiti - Port-au-Prince"},{245,"Honduras - Tegucigalpa"},{102,"Hong Kong - Hong Kong"},{50,"Hungary - Budapest"},{211,"Iceland - Reykjavik"},{1040,"India - Bihar - Patna"},{771,"India - Delhi - Delhi"},{176,"India - Delhi - New Delhi"},{1039,"India - Gujarat - Surat"},{438,"India - Karnataka - Bengaluru"},{1892,"India - Kerala - Thiruvananthapuram"},{1041,"India - Madhya Pradesh - Indore"},{44,"India - Maharashtra - Mumbai"},{1038,"India - Maharashtra - Pune"},{1042,"India - Odisha - Bhubaneshwar"},{4498,"India - Punjab - Ahmedgarh"},{1043,"India - Punjab - Ludhiana"},{553,"India - Tamil Nadu - Chennai"},{1047,"India - Tamil Nadu - Madurai"},{1046,"India - Uttar Pradesh - Agra"},{1045,"India - Uttar Pradesh - Varanasi"},{54,"India - West Bengal - Kolkata"},{761,"Indonesia - Bali - Denpasar"},{631,"Indonesia - East Java - Surabaya"},{434,"Indonesia - East Kalimantan - Balikpapan"},{108,"Indonesia - Jakarta Special Capital Region - Jakarta"},{555,"Indonesia - North Sulawesi - Manado"},{759,"Indonesia - Papua - Jayapura"},{653,"Indonesia - South Sulawesi - Makassar"},{437,"Indonesia - West Java - Bandung"},{2120,"Indonesia - West Kalimantan - Pontianak"},{2436,"Indonesia - West Papua - Manokwari"},{246,"Iran - Tehran"},{27,"Iraq - Baghdad"},{78,"Ireland - Dublin"},{716,"Isle of Man - Douglas"},{110,"Israel - Jerusalem"},{676,"Israel - Tel Aviv"},{157,"Italy - Milan"},{215,"Italy - Rome"},{120,"Jamaica - Kingston"},{540,"Japan - Kobe"},{538,"Japan - Kyoto"},{565,"Japan - Nagoya"},{671,"Japan - Osaka"},{622,"Japan - Sapporo"},{248,"Japan - Tokyo"},{667,"Japan - Yokohama"},{11,"Jordan - Amman"},{382,"Kazakhstan - Almaty"},{916,"Kazakhstan - Aqtobe"},{921,"Kazakhstan - Nursultan"},{2352,"Kazakhstan - Oral"},{170,"Kenya - Nairobi"},{274,"Kiribati - Christmas Island - Kiritimati"},{675,"Kiribati - Tarawa"},{743,"Kosovo - Pristina"},{123,"Kuwait - Kuwait City"},{384,"Kyrgyzstan - Bishkek"},{260,"Laos - Vientiane"},{602,"Latvia - Riga"},{34,"Lebanon - Beirut"},{147,"Lesotho - Maseru"},{161,"Liberia - Monrovia"},{252,"Libya - Tripoli"},{714,"Liechtenstein - Vaduz"},{660,"Lithuania - Vilnius"},{534,"Luxembourg - Luxembourg"},{20,"Madagascar - Antananarivo"},{130,"Malawi - Lilongwe"},{122,"Malaysia - Kuala Lumpur - Kuala Lumpur"},{715,"Maldives - Male"},{29,"Mali - Bamako"},{2328,"Mali - Timbuktu"},{255,"Malta - Valletta"},{717,"Marshall Islands - Majuro"},{718,"Martinique - Fort-de-France"},{183,"Mauritania - Nouakchott"},{201,"Mauritius - Port Louis"},{9,"Mexico - Aguascalientes - Aguascalientes"},{154,"Mexico - Baja California - Mexicali"},{247,"Mexico - Baja California - Tijuana"},{155,"Mexico - Ciudad de México - Mexico City"},{3,"Mexico - Guerrero - Acapulco"},{92,"Mexico - Jalisco - Guadalajara"},{923,"Mexico - Quintana Roo - Cancún"},{148,"Mexico - Sinaloa - Mazatlan"},{503,"Mexico - Sonora - Hermosillo"},{258,"Mexico - Veracruz - Veracruz"},{1072,"Micronesia - Pohnpei - Palikir"},{177,"Moldova - Chișinău"},{674,"Monaco - Monaco"},{950,"Mongolia - Hovd"},{720,"Mongolia - Ulaanbaatar"},{744,"Montenegro - Podgorica"},{60,"Morocco - Casablanca"},{206,"Morocco - Rabat"},{146,"Mozambique - Maputo"},{1981,"Myanmar - Naypyidaw"},{208,"Myanmar - Yangon"},{266,"Namibia - Windhoek"},{276,"Nauru - Yaren"},{117,"Nepal - Kathmandu"},{16,"Netherlands - Amsterdam"},{22,"New Zealand - Auckland - Auckland"},{63,"New Zealand - Chatham Islands - Chatham Islands"},{264,"New Zealand - Wellington - Wellington"},{143,"Nicaragua - Managua"},{180,"Niger - Niamey"},{742,"Nigeria - Federal Capital Territory - Abuja"},{125,"Nigeria - Lagos - Lagos"},{724,"Niue - Alofi"},{205,"North Korea - Pyongyang"},{673,"North Macedonia - Skopje"},{187,"Norway - Oslo"},{737,"Norway - Svalbard - Longyearbyen"},{290,"Norway - Tromsø"},{169,"Oman - Muscat"},{106,"Pakistan - Pastafarianismabad"},{756,"Pakistan - Lahore"},{757,"Pakistan - Sindh - Karachi"},{5606,"Palau - Ngerulmud"},{192,"Panama - Panama"},{193,"Papua New Guinea - Port Moresby"},{21,"Paraguay - Asuncion"},{131,"Peru - Lima - Lima"},{145,"Philippines - Manila"},{755,"Pitcairn Islands - Adamstown"},{262,"Poland - Warsaw"},{271,"Portugal - Azores - Ponta Delgada"},{133,"Portugal - Lisbon - Lisbon"},{226,"Puerto Rico - San Juan"},{8,"Qatar - Doha"},{49,"Romania - Bucharest"},{2437,"Russia - Arkhangelsk - Belushya Guba"},{356,"Russia - Bashkortostan - Ufa"},{373,"Russia - Chelyabinsk - Chelyabinsk"},{17,"Russia - Chukotka - Anadyr"},{3795,"Russia - Chukotka - Pevek"},{378,"Russia - Irkutsk - Irkutsk"},{528,"Russia - Kaliningrad - Kaliningrad"},{114,"Russia - Kamchatka - Petropavlovsk-Kamchatsky"},{2439,"Russia - Khabarovsk - Komsomolsk-on-Amur"},{3735,"Russia - Krasnoyarsk - Khatanga"},{372,"Russia - Krasnoyarsk - Krasnoyarsk"},{381,"Russia - Krasnoyarsk - Norilsk"},{380,"Russia - Magadan - Magadan"},{166,"Russia - Moscow - Moscow"},{167,"Russia - Murmansk - Murmansk"},{353,"Russia - Novgorod - Novgorod"},{375,"Russia - Novosibirsk - Novosibirsk"},{374,"Russia - Omsk - Omsk"},{357,"Russia - Perm - Perm"},{261,"Russia - Primorsky - Vladivostok"},{352,"Russia - Saint Petersburg - Saint-Petersburg"},{4211,"Russia - Sakha (Yakutia) - Srednekolymsk"},{3769,"Russia - Sakha (Yakutia) - Tiksi"},{3767,"Russia - Sakha (Yakutia) - Verkhoyansk"},{1907,"Russia - Sakha (Yakutia) - Yakutsk"},{1245,"Russia - Sakhalin - Yuzhno-Sakhalinsk"},{355,"Russia - Samara - Samara"},{358,"Russia - Sverdlovsk - Yekaterinburg"},{354,"Russia - Tatarstan - Kazan"},{364,"Russia - Udmurtia - Izhevsk"},{4096,"Russia - Zabaykalsky - Chita"},{119,"Rwanda - Kigali"},{216,"Réunion (French) - Saint-Denis"},{727,"Saint Helena - Jamestown"},{728,"Saint Kitts and Nevis - Basseterre"},{729,"Saint Lucia - Castries"},{731,"Saint Vincent and Grenadines - Kingstown"},{282,"Samoa - Apia"},{732,"San Marino - San Marino"},{733,"Sao Tome and Principe - São Tomé"},{151,"Saudi Arabia - Makkah"},{1942,"Saudi Arabia - Medina"},{214,"Saudi Arabia - Riyadh"},{74,"Senegal - Dakar"},{35,"Serbia - Belgrade"},{734,"Seychelles - Victoria"},{85,"Sierra Leone - Freetown"},{236,"Singapore - Singapore"},{735,"Slovakia - Bratislava"},{736,"Slovenia - Ljubljana"},{273,"Solomon Islands - Honiara"},{160,"Somalia - Mogadishu"},{56,"South Africa - Cape Town"},{111,"South Africa - Johannesburg"},{3401,"South Africa - Marion Island (Prince Edward Islands)"},{269,"South Africa - Pretoria"},{1985,"South Georgia/Sandwich Is. - King Edward Point"},{235,"South Korea - Seoul"},{2171,"South Sudan - Juba"},{31,"Spain - Barcelona - Barcelona"},{141,"Spain - Madrid"},{191,"Spain - Majorca - Palma"},{389,"Sri Lanka - Colombo"},{1925,"Sri Lanka - Sri Jayawardenepura Kotte"},{118,"Sudan - Khartoum"},{194,"Suriname - Paramaribo"},{239,"Sweden - Stockholm"},{270,"Switzerland - Bern - Bern"},{87,"Switzerland - Geneva - Geneva"},{268,"Switzerland - Zurich - Zürich"},{487,"Syria - Damascus"},{241,"Taiwan - Taipei"},{385,"Tajikistan - Dushanbe"},{71,"Tanzania - Dar es Salaam"},{1030,"Tanzania - Dodoma"},{28,"Thailand - Bangkok"},{768,"Timor-Leste - Dili"},{135,"Togo - Lomé"},{738,"Tokelau - Fakaofo"},{277,"Tonga - Nuku'alofa"},{588,"Trinidad and Tobago - Port of Spain"},{253,"Tunisia - Tunis"},{19,"Turkey - Ankara"},{1949,"Turkey - Bursa"},{4050,"Turkey - Eskişehir"},{107,"Turkey - Istanbul"},{107,"Turkey - Istanbul"},{387,"Turkmenistan - Ashgabat"},{272,"Tuvalu - Funafuti"},{3399,"US Minor Outlying Islands - Baker Island"},{1890,"US Minor Outlying Islands - Midway"},{2131,"US Minor Outlying Islands - Wake Island"},{407,"USA - Alabama - Montgomery"},{13,"USA - Alaska - Adak"},{18,"USA - Alaska - Anchorage"},{81,"USA - Alaska - Fairbanks"},{112,"USA - Alaska - Juneau"},{931,"USA - Alaska - Unalaska"},{197,"USA - Arizona - Phoenix"},{134,"USA - Arkansas - Little Rock"},{137,"USA - California - Los Angeles"},{217,"USA - California - Sacramento"},{770,"USA - California - San Diego"},{224,"USA - California - San Francisco"},{283,"USA - California - San Jose"},{75,"USA - Colorado - Denver"},{98,"USA - Connecticut - Hartford"},{1029,"USA - Delaware - Dover"},{263,"USA - District of Columbia - Washington DC"},{156,"USA - Florida - Miami"},{867,"USA - Florida - Orlando"},{944,"USA - Florida - Pensacola"},{25,"USA - Georgia - Atlanta"},{103,"USA - Hawaii - Honolulu"},{42,"USA - Idaho - Boise"},{64,"USA - Illinois - Chicago"},{105,"USA - Indiana - Indianapolis"},{76,"USA - Iowa - Des Moines"},{249,"USA - Kansas - Topeka"},{413,"USA - Kentucky - Louisville"},{178,"USA - Louisiana - New Orleans"},{23,"USA - Maine - Augusta"},{419,"USA - Maryland - Baltimore"},{43,"USA - Massachusetts - Boston"},{77,"USA - Michigan - Detroit"},{159,"USA - Minnesota - Minneapolis"},{219,"USA - Minnesota - St. Paul"},{515,"USA - Mississippi - Jackson"},{405,"USA - Missouri - Kansas City"},{605,"USA - Missouri - St. Louis"},{448,"USA - Montana - Billings"},{132,"USA - Nebraska - Lincoln"},{127,"USA - Nevada - Las Vegas"},{68,"USA - New Hampshire - Concord"},{861,"USA - New Jersey - Newark"},{394,"USA - New Mexico - Albuquerque"},{179,"USA - New York - New York"},{207,"USA - North Carolina - Raleigh"},{39,"USA - North Dakota - Bismarck"},{805,"USA - Ohio - Columbus"},{184,"USA - Oklahoma - Oklahoma City"},{202,"USA - Oregon - Portland"},{221,"USA - Oregon - Salem"},{198,"USA - Pennsylvania - Philadelphia"},{878,"USA - Rhode Island - Providence"},{66,"USA - South Carolina - Columbia"},{1920,"USA - South Dakota - Rapid City"},{627,"USA - South Dakota - Sioux Falls"},{843,"USA - Tennessee - Knoxville"},{171,"USA - Tennessee - Nashville"},{24,"USA - Texas - Austin"},{70,"USA - Texas - Dallas"},{104,"USA - Texas - Houston"},{1921,"USA - Texas - Midland"},{220,"USA - Utah - Salt Lake City"},{164,"USA - Vermont - Montpelier"},{212,"USA - Virginia - Richmond"},{234,"USA - Washington - Seattle"},{62,"USA - West Virginia - Charleston"},{142,"USA - Wisconsin - Madison"},{158,"USA - Wisconsin - Milwaukee"},{778,"USA - Wyoming - Cheyenne"},{115,"Uganda - Kampala"},{4060,"Ukraine - Dnipropetrovsk - Dnipro"},{367,"Ukraine - Kyiv - Kyiv"},{366,"Ukraine - Odessa - Odesa"},{2,"United Arab Emirates - Abu Dhabi - Abu Dhabi"},{776,"United Arab Emirates - Dubai - Dubai"},{136,"United Kingdom - England - London"},{919,"United Kingdom - Northern Ireland - Belfast"},{304,"United Kingdom - Scotland - Edinburgh"},{90,"United Kingdom - Scotland - Glasgow"},{298,"United Kingdom - Wales - Cardiff"},{163,"Uruguay - Montevideo"},{244,"Uzbekistan - Tashkent"},{280,"Vanuatu - Port Vila"},{710,"Vatican City State - Vatican City"},{58,"Venezuela - Caracas"},{95,"Vietnam - Hanoi"},{218,"Vietnam - Ho Chi Minh"},{741,"Western Sahara - El Aaiún"},{6,"Yemen - Aden"},{672,"Yemen - Sana"},{140,"Zambia - Lusaka"},{96,"Zimbabwe - Harare"}}


And Note 2:
When registering your Google Sheet for sharing
Set it to "Anyone with the link can view" and save.


--##############################################--
--##############################################--
--##############################################--

Here is a usable sample code:
(My advice is to try this in the table you opened yourself, so you can register the user.
This time I didn't leave the permissions "Open for editing".)

Copy the code and paste it at the top of your existing Trainer code.
In the code, your Trainer name is given as "UDF1" in the example.
Edit it, change it to your own Trainer name and activate the line of code.
This table will run at startup and your Trainer will be hidden. If all steps are successful, this table will close and your Trainer will start.
Code:
--############################################################################--
--############################################################################--
--############################################################################--

function startCheckForm()
if Ufrm1 then Ufrm1.Destroy() Ufrm1=nil end
DP1=getScreenDPI()/96

Ufrm1=createForm() or {}
Ufrm1.height=200*DP1 Ufrm1.width=400*DP1 Ufrm1.left=261*DP1 Ufrm1.top=98*DP1
Ufrm1.PopupMode=0 Ufrm1.caption="ByAylinCE  Trainers"
Ufrm1.Position="poDesktopCenter" Ufrm1.BorderStyle="bsNone"
Ufrm1.setLayeredAttributes(0x000100, 255, LWA_COLORKEY | LWA_ALPHA )
Ufrm1.Color=0x000100
Ufrm1.ShowInTaskBar="stAlways"
-------------------------
----------------------- Ufrm1.Upnl1 -----
Ufrm1.Upnl1=createPanel(Ufrm1)
Ufrm1.Upnl1.AutoSize=false
Ufrm1.Upnl1.height=36*DP1 Ufrm1.Upnl1.width=390*DP1 Ufrm1.Upnl1.left=5*DP1 Ufrm1.Upnl1.top=5*DP1
Ufrm1.Upnl1.Cursor= -22
Ufrm1.Upnl1.Font.Style="fsBold" Ufrm1.Upnl1.Font.Size=14*DP1
Ufrm1.Upnl1.OnMouseDown = function() Ufrm1.DragNow() end
-----------------------
----------------------- Ufrm1.Upnl2 -----
Ufrm1.Upnl2=createPanel(Ufrm1)
Ufrm1.Upnl2.AutoSize=false
Ufrm1.Upnl2.height=110*DP1 Ufrm1.Upnl2.width=390*DP1 Ufrm1.Upnl2.left=5*DP1 Ufrm1.Upnl2.top=45*DP1
Ufrm1.Upnl2.Font.Style="fsBold" Ufrm1.Upnl2.Font.Size=0*DP1
-----------------------
----------------------- Ufrm1.Upnl3 -----
Ufrm1.Upnl3=createPanel(Ufrm1)
Ufrm1.Upnl3.AutoSize=false
Ufrm1.Upnl3.height=36*DP1 Ufrm1.Upnl3.width=390*DP1 Ufrm1.Upnl3.left=5*DP1 Ufrm1.Upnl3.top=130*DP1
Ufrm1.Upnl3.Font.Style="fsBold" Ufrm1.Upnl3.Font.Size=0*DP1
-----------------------
----------------------- Ufrm1.Ubtn1 -----
Ufrm1.Ubtn1=createButton(Ufrm1.Upnl1)
Ufrm1.Ubtn1.AutoSize=false
Ufrm1.Ubtn1.height=26*DP1 Ufrm1.Ubtn1.width=30*DP1 Ufrm1.Ubtn1.left=5*DP1 Ufrm1.Ubtn1.top=5*DP1
Ufrm1.Ubtn1.caption="--"
Ufrm1.Ubtn1.Font.Style="fsBold" Ufrm1.Ubtn1.Font.Size=14*DP1
-----------------------
----------------------- Ufrm1.Ubtn2 -----
Ufrm1.Ubtn2=createButton(Ufrm1.Upnl1)
Ufrm1.Ubtn2.AutoSize=false
Ufrm1.Ubtn2.height=26*DP1 Ufrm1.Ubtn2.width=30*DP1 Ufrm1.Ubtn2.left=355*DP1 Ufrm1.Ubtn2.top=5*DP1
Ufrm1.Ubtn2.caption="X"
Ufrm1.Ubtn2.Font.Style="fsBold" Ufrm1.Ubtn2.Font.Size=14*DP1
-----------------------
----------------------- Ufrm1.Ubtn3 -----
Ufrm1.Ubtn3=createButton(Ufrm1.Upnl3)
Ufrm1.Ubtn3.AutoSize=false
Ufrm1.Ubtn3.height=26*DP1 Ufrm1.Ubtn3.width=100*DP1 Ufrm1.Ubtn3.left=285*DP1 Ufrm1.Ubtn3.top=5*DP1
Ufrm1.Ubtn3.Font.Style="fsBold" Ufrm1.Ubtn3.Font.Size=0*DP1
-----------------------
----------------------- Ufrm1.Uedt1 -----
Ufrm1.Uedt1=createEdit(Ufrm1.Upnl3)
Ufrm1.Uedt1.AutoSize=false
Ufrm1.Uedt1.height=24*DP1 Ufrm1.Uedt1.width=220*DP1 Ufrm1.Uedt1.left=62*DP1 Ufrm1.Uedt1.top=6*DP1
Ufrm1.Uedt1.text=""
Ufrm1.Uedt1.Font.Style="fsBold" Ufrm1.Uedt1.Font.Size=0*DP1
-----------------------
----------------------- Ufrm1.Ulbl1 -----
Ufrm1.Ulbl1=createLabel(Ufrm1.Upnl3)
Ufrm1.Ulbl1.AutoSize=false
Ufrm1.Ulbl1.height=20*DP1 Ufrm1.Ulbl1.width=52*DP1 Ufrm1.Ulbl1.left=5*DP1 Ufrm1.Ulbl1.top=8*DP1
Ufrm1.Ulbl1.OptimalFill=true
Ufrm1.Ulbl1.Font.Style="fsBold" Ufrm1.Ulbl1.Font.Size=-15*DP1
-----------------------
----------------------- Ufrm1.Ulbl2 -----
Ufrm1.Ulbl2=createLabel(Ufrm1.Upnl2)
Ufrm1.Ulbl2.AutoSize=false
Ufrm1.Ulbl2.height=95*DP1 Ufrm1.Ulbl2.width=380*DP1 Ufrm1.Ulbl2.left=2*DP1 Ufrm1.Ulbl2.top=8*DP1
Ufrm1.Ulbl2.alignment="taCenter" Ufrm1.Ulbl2.OptimalFill=true
Ufrm1.Ulbl2.Font.Style="fsBold" Ufrm1.Ulbl2.Font.Size=-23*DP1
-----------------------
--############################################################################--
--############################################################################--
--############################################################################--

function generator(length,episode)
  local capital_letters = {"A", "E", "I", "U", "W", "Q", "X"}
  local low_letters = {"B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "V", "Y", "Z"}
  local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
  math.randomseed(os.time())
  local pass = ""
  local choice = 0
  local nextPass = ""

local function epsd()
  for _ = 1, length do
    choice = math.random(3)

    if choice == 1 then
      pass = pass .. capital_letters[math.random(#capital_letters)]
    elseif choice == 2 then
      pass = pass .. low_letters[math.random(#low_letters)]
    else
      pass = pass .. numbers[math.random(#numbers)]
    end
  end
  return pass
end
 if episode>1 then
  for i = 1, episode do
   pass = ""
   nextPass = nextPass .. "-" .. epsd()
  end
 else
  nextPass = epsd()
 end
 return nextPass
end


--############################################################################--
--############################################################################--
--############################################################################--

if VipTimer1 then VipTimer1.Destroy() VipTimer1=nil end
VipTimer1=createTimer() VipTimer1.Interval=1000 VipTimer1.Enabled=false

local userKey1 = ""
--############################################################################--

settingsKey1=getSettings('keys1')

function SaveKey(nextKey)
settingsKey1.Value['key1'] = nextKey
--print(nextKey)
end

function LoadKey()
loadKey1 = settingsKey1.Value['key1']
  if loadKey1=="" then
   loadKey1 = generator(10,1)
   SaveKey(loadKey1)
   userKey1 = loadKey1
   else
   userKey1 = loadKey1
  end
  VipTimer1.Enabled=true
end

LoadKey()
--print("loadKey1: "..loadKey1)
local reg = [[%WINDIR%/System32/reg.exe ]]
MyId = io.popen(reg..[[ query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient /v MachineId]])

function all_trim()
res1 = ""
 for line in MyId:lines() do
   res1 = res1.." "..line
 end
   res = (res1):match("{(.*)}") --:gsub("%a",""):gsub("-","")
   if res~=nil then
    res1 = (res):gsub("%a",""):gsub("-","")
   end
  return res1
end

userKey1 = userKey1.."-"..all_trim()

--############################################################################--
--############################################################################--
--############################################################################--

Ufrm1.Upnl1.Color = 0xEADE80
Ufrm1.Upnl2.Color = 0xF2EBB2
Ufrm1.Upnl3.Color = 0xEADE80
Ufrm1.Upnl3.Visible = false
Ufrm1.Upnl1.caption="Starting Trainer!"
Ufrm1.Ubtn3.caption="Copy  ID"
Ufrm1.Ulbl1.caption="Your  ID:"
Ufrm1.Ulbl2.caption="-:-Please wait-:-\n-:-Checking version!-:-"
--check version link: (B-1)
--https://docs.google.com/spreadsheets/d/1T3QBsYZd7LhD33_TNoCdPBew8bQztIoVzIZSsY1WcOo
local Version = "11112222"
local loadVers = ""
local loadIndex = 0
local myList = ""
local autorLink = ""
local uName = ""
local sTime = ""
local eTime = ""

--############################################################################--
--############################################################################--

-- Get key from url:
--https://docs.google.com/document/d/131YKsPttxsNH8z5lgWW1dmq_HWAWotHIHvGZ1pCoDkc/edit
--https://docs.google.com/document/d/--> 131YKsPttxsNH8z5lgWW1dmq_HWAWotHIHvGZ1pCoDkc <--/edit
-- key = "131YKsPttxsNH8z5lgWW1dmq_HWAWotHIHvGZ1pCoDkc"

--############################################################################--
--############################################################################--

local checkTbl = {}

function trialTimes(countryId,startTime,endTime)
--print(startTime,endTime)
local url = "https://free.timeanddate.com/clock/n"..countryId.."/tt1/tw0/tm3/td2"
local http = getInternet()
local response = http.getURL(url)
http.destroy()
local month1, day1, year1 = response:match("<span id=t1>(.-)/(.-)/(.-)</span>")

local url1 = "https://free.timeanddate.com/clock/n"..countryId
local http1 = getInternet()
local response1 = http1.getURL(url1)
http1.destroy()
local hour1, min1, sec1, gt = response1:match("<span id=t1>(.-):(.-):(.-) (.-)</span>")
--print(gt)
 if gt=="pm" then hour1 = tonumber(hour1) + 12 end
local now1 = os.time({year=tonumber(year1),month=tonumber(month1),day=tonumber(day1),hour=tonumber(hour1),min=tonumber(min1),sec=tonumber(sec1)})

local month2, day2, year2, hour2, min2, sec2 = startTime:match("(.-)/(.-)/(.-)%-%-(.-):(.-):(.-)")
local month3, day3, year3, hour3, min3, sec3 = endTime:match("(.-)/(.-)/(.-)%-%-(.-):(.-):(.-)")
--print(1, month2, day2, year2, hour2, min2, sec2)
--print(2, month3, day3, year3, hour3, min3, sec3)

START_TIME = os.time({year=tonumber(year2),month=tonumber(month2),day=tonumber(day2),hour=tonumber(hour2),min=tonumber(min2),sec=tonumber(sec2) })
TRIAL_TIME = os.time({year=tonumber(year3),month=tonumber(month3),day=tonumber(day3),hour=tonumber(hour3),min=tonumber(min3),sec=tonumber(sec3) })
NOW_TIME = now1
print(4,TRIAL_TIME)

local diff = function(s1,s2,s3)
local res = ""
 if tonumber(s1)==tonumber(s2) or tonumber(s1)>tonumber(s2) then
   res=s3..": 0.. "
 else
   res1 = tonumber(s2)-tonumber(s1)
   res = s3..": "..res1..".. "
 end
 return res
end

r1=diff(year1,year3,"Year") r2=diff(month1,month3,"Month") r3=diff(day1,day3,"Day")
r4=diff(hour1,hour3,"Hour") r5=diff(min1,min3,"Min")
r6 = r1..r2..r3..r4..r5

 if NOW_TIME > TRIAL_TIME then
  Ufrm1.Ulbl2.caption="The trainer has expired. Please request a new access right!\nStart Time: "..os.date('%d/%m/%Y-%H:%M:%S',START_TIME).."\nTrial time: "..os.date('%d/%m/%Y-%H:%M:%S',TRIAL_TIME).."\nNow: "..os.date('%d/%m/%Y-%H:%M:%S',NOW_TIME).."\nRemaining Time: "..r6
  --closeCE()
  else
  Ufrm1.Ulbl2.caption="Hello again  "..uName.." \nWe wish you good games.\nValid use and expiry time:\nStart Time: "..os.date('%d/%m/%Y-%H:%M:%S',START_TIME).."\nTrial time: "..os.date('%d/%m/%Y-%H:%M:%S',TRIAL_TIME).."\nNow: "..os.date('%d/%m/%Y-%H:%M:%S',NOW_TIME).."\nRemaining Time: "..r6
    VipTimer1.Enabled=true
 end
end

function loadURL_E(key)
local result = ""
local url = "https://docs.google.com/spreadsheets/d/"..key.."/export?format=csv"
 local http = getInternet()
 result = http.getURL(url)
 http.Destroy()
 --print(result)
return result
end

function loadList2()
myList = loadURL_E("1T3QBsYZd7LhD33_TNoCdPBew8bQztIoVzIZSsY1WcOo")
--print(myList)
sl = createStringList()
sl.Text = myList
  for i=0, sl.Count -1 do
   loadt1 = sl[i]
   --print(loadt1)
   local u1,u2,u3,u4 = loadt1:match("(.-),(.-),(.-),(.*)")
   print(i,u1,u2,u3,u4)
    a = {u1,u2,u3,u4} --A..B..C..D..
     checkTbl[tonumber(i)+1] = a
  end
sl.Destroy()
end

function checkUser2()
local check1 = 0
  for i=1, #checkTbl do
   loadt1 = checkTbl[i][2]
    if loadt1==userKey1 then
     check1 = 1
     uName = checkTbl[i][1]
     sTime = checkTbl[i][3]
     eTime = checkTbl[i][4]
    end
  end
sl.Destroy()
return check1
end

--############################################################################--
--############################################################################--

function checkVersion()
VipTimer1.Enabled=false
local trainerName = checkTbl[1][1]
local vrsn1 = checkTbl[1][2]
local autor = checkTbl[1][3]
autorLink = checkTbl[1][4]
  if vrsn1==Version then
    Ufrm1.Ulbl2.caption=trainerName.."\n"..autor.."\nThe version is up to date!"
    VipTimer1.Enabled=true
  else
    Ufrm1.Ulbl2.caption=trainerName.."\n"..autor.."\nIt looks like there is a new version.\nPlease contact the Admin!"
    VipTimer1.Enabled=false
  end
end

function checkUserKey()
VipTimer1.Enabled=false
Ufrm1.Ulbl2.caption="ID is being queried...\nThanks for waiting."
local res = checkUser2()
  if res==1 then
    -- example Country: Amsterdam, Netherlands id = 48
    --visit : https://free.timeanddate.com/clock/n48
    trialTimes(48,sTime,eTime)
  else
    Ufrm1.Ulbl2.caption="You are not a registered user.\nPlease click the copy button below to get the code.\nSend the code to the\nAdmin for registration application!"
    Ufrm1.Uedt1.text = userKey1
    Ufrm1.Upnl3.Visible = true
    VipTimer1.Enabled=false
  end
end
-- check save user name and key link: Since this example is the record, I left the permissions on as "Editable".
-- You, in your own list document, for the necessary registration and sharing permission; Confirm as "Anyone with the link".
-- https://docs.google.com/document/d/131YKsPttxsNH8z5lgWW1dmq_HWAWotHIHvGZ1pCoDkc

Ufrm1.Ubtn3.OnClick=function()
aatext=Ufrm1.Uedt1.text
writeToClipboard(aatext)
sleep(80)
--showMessage("User ID:\n" .. aatext .. "\nCopy successful!")

local answer = messageDialog("User ID:\n" .. aatext .. "\nCopy successful!\nWould you like to connect to\nadmin for registration?", mtWarning, mbYes, mbNo)
  if answer == mrYes then
   shellExecute(autorLink)
  end
sleep(180)
end
--############################################################################--
--############################################################################--
--############################################################################--

function startMyTrainer()
if VipTimer1 then VipTimer1.Destroy() VipTimer1=nil end
if Ufrm1 then Ufrm1.Destroy() Ufrm1=nil end
--your trainer name? sample: UDF1
UDF1.Show()
end

VipTimer1.OnTimer=function()
loadIndex=tonumber(loadIndex) + 1
  if loadIndex==3 then loadList2() end
  if loadIndex==6 then checkVersion() end
  if loadIndex==9 then Ufrm1.Ulbl2.caption="ID is being queried...\nThanks for waiting." end
  if loadIndex==12 then checkUserKey() end
  if loadIndex==15 then
    --startMyTrainer()
    --Ufrm1.Ulbl2.caption="If you've come this far,\neverything went well.\nYou can now start the main Trainer!"
    VipTimer1.Enabled=false
  end
end
end

--hide your Trainer.. Start check user form!
--your trainer name? sample: UDF1

--UDF1.Hide()
startCheckForm()


Note: If the code worked for you, you can appreciate it by clicking on the reputation finger under the Profile picture.

Stay with the codes until we meet on another crazy topic.
And enjoy it. Smile

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
a2z
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 58

PostPosted: Mon Sep 25, 2023 9:08 am    Post subject: Reply with quote

The Trial time sometimes was giving me wrong output. E.g. I put
Trial Start: 09/25/2023--00:00:00
Trial End: 03/25/2024--00:00:00
Which is 6 months, but it was showing me more than a Year..

I have changed some parts to fit what I needed.
Date format: day/month/year
Time format: 24hrs
Remaining Trial : Days, Hours, Minutes, Seconds (Year variable due to leap year, and month variable can be 28, 29, 30 or 31. So I Opted out of year and month).

Code:
function trialTimes(countryId,startTime,endTime)

  local url = "https://free.timeanddate.com/clock/n"..countryId.."/tt1/tw0/tm3/td2"
  local http = getInternet()
  local response = http.getURL(url)
  http.destroy()
  local month1, day1, year1 = response:match("<span id=t1>(.-)/(.-)/(.-)</span>")
 
  local url1 = "https://free.timeanddate.com/clock/n"..countryId.."/th1"
  local http1 = getInternet()
  local response1 = http1.getURL(url1)
  http1.destroy()
  local hour1, min1, sec1 = response1:match("<span id=t1>(.-):(.-):(.-)</span>")

  local day2, month2, year2, hour2, min2, sec2 = startTime:match("(.-)/(.-)/(.-)%-%-(.-):(.-):(.-)")
  local day3, month3, year3, hour3, min3, sec3 = endTime:match("(.-)/(.-)/(.-)%-%-(.-):(.-):(.-)")

  NOW_TIME = os.time({year=tonumber(year1),month=tonumber(month1),day=tonumber(day1),hour=tonumber(hour1),min=tonumber(min1),sec=tonumber(sec1)})
  START_TIME = os.time({year=tonumber(year2),month=tonumber(month2),day=tonumber(day2),hour=tonumber(hour2),min=tonumber(min2),sec=tonumber(sec2)})
  END_TIME = os.time({year=tonumber(year3),month=tonumber(month3),day=tonumber(day3),hour=tonumber(hour3),min=tonumber(min3),sec=tonumber(sec3)})
  TRIAL_TIME_REMAINING = END_TIME - NOW_TIME

  function ConvertSecondsToDHMS(seconds)
    local days = math.floor(seconds / 86400)
    seconds = seconds % 86400
    local hours = math.floor(seconds / 3600)
    seconds = seconds % 3600
    local minutes = math.floor(seconds / 60)
    local remainingSeconds = seconds % 60
    return days, hours, minutes, remainingSeconds
  end
 
  local days, hours, minutes, seconds = ConvertSecondsToDHMS(TRIAL_TIME_REMAINING)
  TIME_REMAINING = days.." Days, "..hours.." Hours, "..minutes.." Minutes, "..seconds.." Seconds"

  if NOW_TIME > END_TIME then
    Ufrm1.Ulbl2.caption="The trainer has expired. Please request a new access right!\nStart Time: "..os.date('%d/%m/%Y-%H:%M:%S',START_TIME).."\nEnd Time: "..os.date('%d/%m/%Y-%H:%M:%S',END_TIME).."\nTime Now: "..os.date('%d/%m/%Y-%H:%M:%S',NOW_TIME).."\nRemaining Time: "..0
  else
    Ufrm1.Ulbl2.caption="Hello again  "..uName.." \nWe wish you good games.\nValid use and expiry time:\nStart Time: "..os.date('%d/%m/%Y-%H:%M:%S',START_TIME).."\nEnd Time: "..os.date('%d/%m/%Y-%H:%M:%S',END_TIME).."\nTime Now: "..os.date('%d/%m/%Y-%H:%M:%S',NOW_TIME).."\nRemaining Time: "..TIME_REMAINING
    VipTimer1.Enabled=true
  end
end



Clicked the reputation finger.

If I have more trainers and I would like to keep the verification data of each trainer separate on different sheets by adding sheet on the same excel document (as in the image), how would I go about doing that?
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Thu Dec 14, 2023 12:54 am    Post subject: Reply with quote

This requires complete modification with a different idea to the entire reading code.
Reading the Trainer game name and version is taken from the first line for different game Trainer and requires spreading across multiple lines.

My advice is to open different documents for different game Trainers using the same base code.
This approach means less workload for the code that reads and parses the document.
(As the rows increase, the reading procedure becomes slower.)
Additionally, a user who purchased 2 Trainers will have 2 different time periods with the same ID, and parsing this into a single document requires an additional element to the document table.

The entire document and code changes.
Document;
Trainer game name
Trainer usage version
User ID
User name
Starting date
End date

It contains 6 items.

In the code, a different test code based on the Trainer game name should be written for 6 items instead of 4 in the document list (Table parsing items.) and after finding the user ID.

If you are still determined to list all these changes in a single document, leave a comment. Smile

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites