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 


URL read error!

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

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sat May 11, 2019 10:51 am    Post subject: URL read error! Reply with quote

Hi!
"table_url" does not read the URL in CEEdit or CELabel.


Code:
local int=getInternet()
  URL="Bla..bla.."
  s=int.getURL(URL)
  UDF1.CEEdit1.Text=(s)

table_url = UDF1.CEEdit1.Text



But the following method works smoothly.

Code:
table_url = "Bla..bla.."


How do I read the URL in CEEdit or CELabel?

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat May 11, 2019 1:25 pm    Post subject: Reply with quote

Not sure understand what you wish, but form your code I try to get the point.

Because you did not tell details about the URL mean.
URL, Uniform Resource Locator is the address of a World Wide Web page. The URL has a URL Name (Address) and URL Contains (Web Pages). So, from your code, let say I have a URL Address:


Code:
local int=getInternet()
URL="https://forum.cheatengine.org/viewtopic.php?t=610046"  -- let say this URL
s=int.getURL(URL)
UDF1.CEEdit1.Text=(s)

table_url = UDF1.CEEdit1.Text

UDF1.show()


When execute this code line:

Code:
s=int.getURL(URL)


It will return URL Contains = Web Pages, looking like this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">

<link rel="top" href="./index.php" title="Cheat Engine Forum Index" />
<link rel="search" href="./search.php" title="Search" />
<link rel="help" href="./faq.php" title="FAQ" />
<link rel="author" href="./memberlist.php" title="Memberlist" />
<link rel="prev" href="viewtopic.php?t=610046&amp;view=previous" title="View previous topic" />
<link rel="next" href="viewtopic.php?t=610046&amp;view=next" title="View next topic" />
<link rel="up" href="viewforum.php?f=126" title="Cheat Engine Lua Scripting" />
<link rel="chapter forum" href="viewforum.php?f=1" title="Cheat Engine" />
<link rel="chapter forum" href="viewforum.php?f=126" title="Cheat Engine Lua Scripting" />
<link rel="chapter forum" href="viewforum.php?f=130" title="Cheat Engine Extensions" />
<link rel="chapter forum" href="viewforum.php?f=7" title="Cheat Engine Tutorials" />
<link rel="chapter forum" href="viewforum.php?f=3" title="General Gamehacking" />
<link rel="chapter forum" href="viewforum.php?f=15" title="Auto Assembler tutorials" />
<link rel="chapter forum" href="viewforum.php?f=14" title="Pointer tutorials" />
<link rel="chapter forum" href="viewforum.php?f=17" title="Game specific tutorials" />
<link rel="chapter forum" href="viewforum.php?f=116" title="Webbrowser stuff related tutorials" />
<link rel="chapter forum" href="viewforum.php?f=118" title="Console Modding" />
<link rel="chapter forum" href="viewforum.php?f=125" title="LUA Tutorials" />
<link rel="chapter forum" href="viewforum.php?f=52" title="General Discussions" />
<link rel="chapter forum" href="viewforum.php?f=78" title="Art" />
<link rel="chapter forum" href="viewforum.php?f=49" title="Computer Talk" />
<link rel="chapter forum" href="viewforum.php?f=16" title="Random spam" />
<link rel="chapter forum" href="viewforum.php?f=87" title="Art Requests" />
<link rel="chapter forum" href="viewforum.php?f=106" title="Art Tutorials" />
<link rel="chapter forum" href="viewforum.php?f=112" title="Willekeurige Rotzooi" />
<link rel="chapter forum" href="viewforum.php?f=122" title="Guests" />
<link rel="chapter forum" href="viewforum.php?f=131" title="Horse Excrement" />
<link rel="chapter forum" href="viewforum.php?f=11" title="Single player cheat request" />
<link rel="chapter forum" href="viewforum.php?f=4" title="Tables" />
<link rel="chapter forum" href="viewforum.php?f=18" title="Trainers" />
<link rel="chapter forum" href="viewforum.php?f=19" title="Auto Assemble scripts" />
<link rel="chapter forum" href="viewforum.php?f=6" title="Cheat Engine Source" />
<link rel="chapter forum" href="viewforum.php?f=26" title="CETC Server and Clients" />
<link rel="chapter forum" href="viewforum.php?f=66" title="DBVM" />
<link rel="chapter forum" href="viewforum.php?f=27" title="Plugin development" />
<link rel="chapter forum" href="viewforum.php?f=38" title="General programming" />
<link rel="chapter forum" href="viewforum.php?f=65" title="Binaries" />
<link rel="chapter forum" href="viewforum.php?f=39" title="Crackmes" />
<link rel="chapter forum" href="viewforum.php?f=47" title="General programming+" />
<link rel="chapter forum" href="viewforum.php?f=79" title="Game Development" />
<link rel="chapter forum" href="viewforum.php?f=97" title="2D Graphics" />
<link rel="chapter forum" href="viewforum.php?f=95" title="3D Modeling" />
<link rel="chapter forum" href="viewforum.php?f=96" title="Gameplay design" />
<link rel="chapter forum" href="viewforum.php?f=119" title="Web Development" />
<link rel="chapter forum" href="viewforum.php?f=40" title="Flash Games" />
<link rel="chapter forum" href="viewforum.php?f=44" title="Gaia Online" />
<link rel="chapter forum" href="viewforum.php?f=30" title="Stick Arena" />

<title>Cheat Engine :: View topic - URL read error!</title>
<!-- link rel="stylesheet" href="templates/subSilver/subSilver.css" type="text/css" -->
<style type="text/css">
<!--
/*

*/

/* General page style. The scroll bar colours only visible in IE5.5+ */
body {
   background-color: #979797;
   scrollbar-face-color: #939393;
   scrollbar-highlight-color: #979797;
   scrollbar-shadow-color: #939393;
   scrollbar-3dlight-color: #8e8e8e;
   scrollbar-arrow-color:  #006699;
   scrollbar-track-color: #979797;
   scrollbar-darkshadow-color: #000000;
}

/* General font families for common tags */
font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
a:link,a:active,a:visited { color : #006699; }
a:hover      { text-decoration: underline; color : #000000; }
hr   { height: 0px; border: solid #8e8e8e 0px; border-top-width: 1px;}

/* This is the border line & background colour round the entire page */
.bodyline   { background-color: #979797; border: 1px #000000 solid; }

/* This is the outline round the main forum tables */
.forumline   { background-color: #979797; border: 2px #000000 solid; }

/*

---- AND SO ON...


Next, you said:
Code:
How do I read the URL in CEEdit or CELabel?

What this question means?. Read URL Address or read (GET) URL contains from a URL Address provided on CEEdit / CELabel ?.
Or read (GET) URL Contains and then put it onto a table_url?. I don't know if the URL contains can append to a Lua table.

Example use CEMemo:

Code:
local int=getInternet()
URL="https://forum.cheatengine.org/viewtopic.php?t=610046"
s=int.getURL(URL)
--UDF1.CEEdit1.Text=(s)

--table_url = UDF1.CEEdit1.Text

UDF1.CEMemo1.Lines.Add(s)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sat May 11, 2019 4:46 pm    Post subject: Reply with quote

Thanks for the reply is #Corroder
The code below will be familiar.
I get a download error: "table_url = e1.caption"
But "table_url = Direct link" is successful.
How do I make the download URL read in "Label or Edit"?

Code:
form = createForm(true) form.Position = poDesktopCenter form.Width = 500 form.Height = 80
b1 = createButton(form) b1.Height = 24 b1.Left = 5 b1.Top = 5 b1.caption = "Check"
e1 = createLabel(form) e1.Left = 5 e1.Top = 40 e1.Width = 490 --Label or Edit!

b1.OnClick = function()
    local int=getInternet()
  URL="https://docs.google.com/document/d/1DyYMCsi7Ux_-JpFGI9ln4A9lzr7DPNrxEyPH1_IK6jY/export?format=txt"
  s=int.getURL(URL)
  e1.caption=(s)

local TABLE_VERSION = 34
local version_url = "https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt"
local table_url = e1.caption --If there is an error, use direct connection "https://sites.google.com/site/cretorbykarahanli/Trainer2.CETRAINER?attredirects=0&d=1"
local http = getInternet()
local result = http.getURL(version_url)
if result then
  local version = tonumber(result:match("%d+"))
  if version > TABLE_VERSION then
    local answer = messageDialog("There is a newer version of this table.\nWould you like to download it now?", mtWarning, mbYes, mbNo)
    if answer == mrYes then

      messageDialog("Caution:\nThis update will permanently delete the old version.\nIf you do not want to delete the old version,\nget a copy before you approve!", mtInformation, mbOK)
      local latest = http.getURL(table_url)
      if latest ~= nil then
      path = TrainerOrigin or getMainForm()
local name = path .. "\\GameV35.CETRAINER"
        local file = io.open(name, "wb")
        file:write(latest)
        file:close()
       local name = os.execute(name, "\\GameV35.CETRAINER")
       local file = os.remove(path .. "\\GameV34.CETRAINER");
        closeCE()
        loadTable(name)
      else
        messageDialog("Failed to load the new table!", mtError, mbOK)
      end
    end
  else
    messageDialog("You currently have the latest version!", mtInformation, mbOK)
  end
else
  messageDialog("Failed to find latest version!", mtError, mbOK)
end
http.destroy()
  int.destroy()
assert(true)
end

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat May 11, 2019 9:56 pm    Post subject: Reply with quote

Try this :

Code:
form = createForm(true) form.Position = poDesktopCenter form.Width = 500 form.Height = 80
b1 = createButton(form) b1.Height = 24 b1.Left = 5 b1.Top = 5 b1.caption = "Check"
e1 = createLabel(form) e1.Left = 5 e1.Top = 40 e1.Width = 490 --Label or Edit!

local table_url ="https://docs.google.com/document/d/1DyYMCsi7Ux_-JpFGI9ln4A9lzr7DPNrxEyPH1_IK6jY/export?format=txt"
local version_url = "https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt"
local onboard_version = 34
local latest_version
local http = getInternet()
--local version = http.getURL(version_url)

function checkVersion()
 local int=getInternet()
 s=int.getURL(version_url)

 if (s) then
  latest_version = tonumber(s:match("%d+"))
  if latest_version > onboard_version then
   e1.caption = 'Your version : '..onboard_version..' <> Latest version : '..latest_version
   local answer = messageDialog("There is a newer version of this table.\nWould you like to download it now?", mtWarning, mbYes, mbNo)
    if answer == mrYes then
      messageDialog("Caution:\nThis update will permanently delete the old version.\nIf you do not want to delete the old version,\nget a copy before you approve!", mtInformation, mbOK)
      local latest = http.getURL(table_url)
       if latest ~= nil then
        path = TrainerOrigin or getMainForm()
        local name = path .. "\\GameV35.CETRAINER"
        local file = io.open(name, "wb")
        file:write(latest)
        file:close()
        local name = os.execute(name, "\\GameV35.CETRAINER")
        local file = os.remove(path .. "\\GameV34.CETRAINER");
        closeCE()
        loadTable(name)
      else
        messageDialog("Failed to load the new table!", mtError, mbOK)
      end
     end
    else
    messageDialog("You currently have the latest version!", mtInformation, mbOK)
    end
   else
    messageDialog("Failed to find latest version!", mtError, mbOK)
   end
 http.destroy()
 int.destroy()
 assert(true)
end

b1.onClick = checkVersion

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sun May 12, 2019 4:32 am    Post subject: Reply with quote

Thanks for the answer, man.
The example you gave: creating a fake ".CETRAINER".
The new version is not downloading.
Have you tried my shared code?
Please do the following change:

This method gives an error.
Code:
local table_url = e1.caption


Replace with the following:
Code:
local table_url = "https://sites.google.com/site/cretorbykarahanli/Trainer2.CETRAINER?attredirects=0&d=1"


The operation succeeds when you give the download link directly.
But when you read it from e1.caption, it is an error.
Question: Download link; "e1.caption or e1.Text"
How can I read through?

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun May 12, 2019 9:01 am    Post subject: Reply with quote

'
Quote:
Have you tried my shared code?


About sharing my code:
1. Yes, but I will give direct link URL and the code without any encoding method. So, for who want to use my code
2. And yes again, if there updated code, then I use my own code which is different from your share code method.

About my answer for your first thread:
Then seem I misunderstand what you want.
If I am not misunderstanding (again and again), what you want is put the URL address on a CELabel caption or CEEdit text, right?.

Anyway, as you wish, just for sample:

Code:
form = createForm(true) form.Position = poDesktopCenter form.Width = 500 form.Height = 80
b1 = createButton(form) b1.Height = 24 b1.Left = 5 b1.Top = 5 b1.caption = "Check"
e1 = createLabel(form) e1.Left = 5 e1.Top = 40 e1.Width = 490 --Label or Edit!
e2 = createLabel(form) e2.setPosition(1000,1000)

local txt = "https://docs.google.com/document/d/1DyYMCsi7Ux_-JpFGI9ln4A9lzr7DPNrxEyPH1_IK6jY/export?format=txt"

e1.Font.Color = '16711680'
e1.Font.Style = 'fsUnderline'
e1.caption = 'Download'
e1.Cursor = -21
local path = TrainerOrigin or getMainForm()

function dnload()
 local http = getInternet()
 local table_version = http.getURL(txt)
 e1.Caption = table_version --"https://sites.google.com/site/cretorbykarahanli/Trainer2.CETRAINER?attredirects=0&d=1"
 txt = e1.caption
 local new_table = http.getURL(table_version)
 if new_table then
  local name = path .. "\\Trainer2.CETRAINER"
  local file = io.open(name, "wb")
  file:write(new_table)
  file:close()
  local name = os.execute(name, "\\Trainer2.CETRAINER")
--  closeCE()
  loadTable(name)
 end
end

e1.onMouseDown = dnload


BUT :
The trainer will not download because, when executing this line and try to print the result:

Code:
local table_version = http.getURL(txt)
print(table_version)

--- result is UNICODE: https://sites.google.com/site/cretorbykarahanli/Trainer2.CETRAINER?attredirects=0&d=1
--- try to copy the print result, open notepad and paste there and then try to save as a text file. A Warning pop-up about UNICODE.

e1.Caption = table_version
--- will give result as the label caption: https://sites.google.com/site/cretorbykarahanli/Trainer2.CETRAINER?attredirects=0d=1 (without '&' symbol near the end)
--- So, the URL for the hacking table has changed. That is causing the failure to download hack table/CETRAINER.


To solve it, try to change the URL provider instead of google text. Something like github, etc and get new URL link for hack table.
Or, make a function to convert UNICODE string type to ANSI string type/normal text type.

_________________
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