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 


I need 2 codes if thats is possible

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Sun Dec 11, 2016 1:34 pm    Post subject: I need 2 codes if thats is possible Reply with quote

1st code :

I need code that scan for mac addresses of trainer users and send the mac to my sql data base .
or any easy code thats I can protect my trainer with ( make trainer per user to prevent sharing of user name and pw ) .

2nd code :
I need lua code to scan text strings search for this text
username=mada
if username=mada
then do nothing
else
exit the game . //I need any code to break or exit the process
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Dec 11, 2016 2:49 pm    Post subject: This post has 1 review(s) Reply with quote

Code:
function getMAC()
  local mac = nil
  local p = io.popen("getmac /v /fo list")
  while true do
    local line = p:read()
    if line == nil then break end
    if line:sub(1, 18) == "Physical Address: " then
      mac = line:sub(19)
    end
  end
  p:close()
  return mac
end

Code:
function sendMAC(mac)
  local url = "http://www.google.com?mac="..mac
  local http = getInternet()
  local file = http.getURL(url)
  http.destroy()
  return file
end

Code:
function verifyUser(user, pass, match)
  if user..":"..pass == match then
    print("Logging in...")
  else
    closeCE()
  end
end
verifyUser("me","1234","me:1234")
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Sun Dec 11, 2016 4:06 pm    Post subject: This post has 1 review(s) Reply with quote

oops, nvm, I not aware Zanzer's code is process line by line, sorry~
---
Should be no "/v" ? With "/v" there are also "Connection Name" and "Network Adapter" displayed before the address in my console.
Anyway this should work,
Code:

mac = line:match"Physical Address:%s+(%S+)"

_________________
- Retarded.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Dec 12, 2016 5:35 pm    Post subject: Reply with quote

Twistedfate wrote:
add print command to print mac address please idk wont work for me
Code:
local mac = getMAC()
print(mac)
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Dec 12, 2016 10:05 pm    Post subject: Reply with quote

Is it possible with this (to get MAC address) ?

Code:

local f = io.popen('arp -a')  // or ("ifconfig) to get IP -- linux
local t = f:read()
f:close()
local mac = t:match("HWaddr ([%:%x]*)")

// get cmd result
function os.capture(cmd, raw)
  local f = assert(io.popen(cmd, 'r'))
  local s = assert(f:read('*a'))
  f:close()
  if raw then return s end
  s = string.gsub(s, '^%s+', '')
  s = string.gsub(s, '%s+$', '')
  s = string.gsub(s, '[\n\r]+', ' ')
  return s
end

// or in cmd prompt use  :

getmac /s viper

or

getmac /s <machine> /u <username> /p


regards
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites