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 


Get a list of drives

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Wed Oct 14, 2020 9:12 am    Post subject: Re: Get a list of drives Reply with quote

yazigegeda wrote:
How does Lua....


You said Lua, so ask this question at CEF Lua Scripting section. The section made by the owner for this. Do not underestimate the rules that have been made.

For now, here:

Code:
function GetDriveLetters() -- return an array table of drive letters
  local M = executeCodeLocal'GetLogicalDrives'
  local drives, dc,dclast = {}, string.byte('AZ',1,3)
  while M and M ~= 0 and dc <= dclast do
    if (M & 1) ~= 0 then drives[1+#drives] = string.char(dc)..":\\" end
    dc, M = dc + 1, M >> 1
  end
  return drives
end
--
print(table.concat(GetDriveLetters(),'\r\n'))

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
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