Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

[04 February 2016] MD5Encode, Base64Encode, Base64Decode, CreateDir, RemoveDir, DirExists, GetTextRect, Interact.


  • This topic is locked This topic is locked
No replies to this topic

#1
Feretorix

Feretorix

    Administrator

  • Administrators
  • 3,144 posts
MD5Encode("hello world!") -- returns a md5 hash of the string "hello world!"
Base64Encode("hello world!") -- returns an encoded string "hello world!"
Base64Decode("aGVsbG8gd29ybGQh") --returns a decoded string "hello world!"



CreateDir(COMMON_PATH.."YourTestHere\\") --returns a boolean on success/failure of creating a folder in the subdirs of GoS.
RemoveDir(COMMON_PATH.."YourTestHere\\") --returns a boolean on success/failure of removing a folder in the subdirs of GoS.
DirExists(COMMON_PATH.."YourTestHere\\") --returns a boolean if a folder exists or not in the subdirs of GoS.


GetTextRect("hello world!",35,200,200); --returns a x,y,w,h rect of the text area.
Args are as follows: Text, Size, OnScreenX, OnScreenY.


Interact(Object) -- allows you to interact with objects such as Crystal Scar towers, Thresh Lantern, Bard portals and much more.



Some code examples:
 
local savedobject = nil

local mychampname = myHero.charName
PrintChat(mychampname);
PrintChat(MD5Encode(mychampname));
local base64str = Base64Encode(mychampname);
PrintChat(base64str);
PrintChat(MD5Encode(base64str));
PrintChat(Base64Decode(base64str));



CreateDir(COMMON_PATH.."YourTestHere\\");
wtf = DirExists(COMMON_PATH.."YourTestHere\\");
if wtf == true then
	PrintChat("<font color='#ff0000'>EXISTS!</font>");
	else
	PrintChat("<font color='#00ff00'>MISSING!</font>");
	end

RemoveDir(COMMON_PATH.."YourTestHere\\");
wtf = DirExists(COMMON_PATH.."YourTestHere\\");
if wtf == true then
	PrintChat("<font color='#ff0000'>EXISTS!</font>");
	else
	PrintChat("<font color='#00ff00'>ERASED!</font>");
	end


OnCreateObj(function(Object)
if Object ~= nil then
	if Object.name == 'ThreshLantern' then
		savedobject = Object
		end
	end
end)

OnDraw(function(myHero)
if savedobject ~= nil then
	DrawCircle(GetOrigin(savedobject),100,0,0,ARGB(255,255,255,255)); --draw current pos
	Interact(savedobject);
	end

DrawText("Hello there !!!!!!!!!!!!",35,200,200,0xffffffff);
textrect = GetTextRect("Hello there !!!!!!!!!!!!",35,200,200);
if textrect ~= nil then
	FillRect(textrect.x,textrect.y,textrect.w,textrect.h,0x50ffffff);
	end

end)


  • 4




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users