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 


getInternet Headers?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Sat Jul 24, 2021 2:40 am    Post subject: getInternet Headers? Reply with quote

how can i use headers while using getInternet
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Sat Jul 24, 2021 4:27 am    Post subject: Reply with quote

Code:
Internet class (Object)
global function(s)
  getInternet(String) - Returns an internet class object. The string provided will be the name of the client provided

properties
  Header : String - The additional header to be sent with the next getURL request
methods
  getURL(Path) - Returns a string containing the contents of the url. nil on failure
  postURL(Path, URLEncodedData) - Posts the given data to the path and returns the results
Back to top
View user's profile Send private message
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Sat Jul 24, 2021 8:48 am    Post subject: Reply with quote

can you give an example i dont know how to use it Embarassed
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Sat Jul 24, 2021 10:34 am    Post subject: Reply with quote

I'm not a fan of spoon-fed answers so I will ask for what purpose is it? Also, if I may ask, are you familiar with the HTTP GET/POST structure?
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Sat Jul 24, 2021 11:25 am    Post subject: Reply with quote

In order not to prolong the subject and to focus on the solution;

Code:
function LoadUrl(link)
  local int=getInternet()
  s=int.getURL(link)
  int.destroy()
  load(s)()
end

LoadUrl("http://cheatengine.org/examplescript.lua")


or

Code:
function createPictureFromURL(url)
 local http = getInternet()
 local file = http.getURL(url)
 http.destroy()
 local picture = createPicture()
 local stream = createStringStream(file)
 picture.loadFromStream(stream)
 return picture
end

if form then form.destroy() form = nil end
form = createForm()
form.Popupmode = 0;
form.Position = poDesktopCenter

local FrmImg1 = createImage(form)
FrmImg1.Left=50 FrmImg1.Height=240 FrmImg1.Top=5 FrmImg1.Width=240

FrmImg1.Picture=createPictureFromURL("https://i.hizliresim.com/GUwjei.png")
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