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 


Write to remote server (REPEAT)

 
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: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Tue Jan 07, 2020 12:19 am    Post subject: Write to remote server (REPEAT) Reply with quote

Hello again.
Is there a simple code to send text to the document on the remote server?
I'm bringing this up again, but that's what I've been interested in lately.
There are some trials below, unfortunately it doesn't work.

Code:
function Write()
local int=getInternet()
local ad = "Admin: "
local text = ("\n"..ad.." "..UDF1.CEEdit1.Text)
  URL="https://docs.google.com/document/d/1cvHv3L14MjqTQavpnUVRkvDf6z4_Ss5_y60F7xj__mw/edit="..text.."&is64bit="..tostring(cheatEngineIs64Bit())
  s=int.getURL(URL)
  int.destroy()
end


or

Code:
function Write()
local ad = "Admin: "
local text = ("\n"..ad.." "..UDF1.CEEdit1.Text)
  local int=getInternet()
local URL = 'https://docs.google.com/document/d/1cvHv3L14MjqTQavpnUVRkvDf6z4_Ss5_y60F7xj__mw/edit='
local s = int.getURL(URL)
text=io.popen(s, "w")
text:write(s)
int.destroy()
end


Do you have corrections or a different idea?
Thanks in advance.

_________________
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
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25827
Location: The netherlands

PostPosted: Tue Jan 07, 2020 1:33 am    Post subject: Reply with quote

first find out how to do that with just editing the browser url

once you have that working(only then), then keep in mind you also have to urlencode the text. e.g. you can't have spaces or newlines but have to use their hexadecimal equivalents

an implementation of such a converter can be found at https://github.com/cheat-engine/cheat-engine/blob/cb4143bb245eed8692c9f1bdd2385ab5a91b077e/Cheat%20Engine/bin/autorun/ceshare.lua#L255

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Tue Jan 07, 2020 4:28 am    Post subject: Reply with quote

I still can't find an example of sending articles to Google documents or a similar platform.
This coding is beyond me. Smile


Code:
local function encodeAuth(str)
if (str) then
    --str = string.gsub (str, "\n", "\r\n")
    str = string.gsub (str, "([^%w %-%_%.%~])",
        function (c) return string.format ("%%%02X", string.byte(c)) end)
    str = string.gsub (str, " ", "+")
  end
  return str
end

function Write()
local ad = "Admin: "
local text2 = ("\n"..ad.." "..UDF1.CEEdit1.Text)
local text = encodeAuth(text2)
  local int=getInternet()
local URL = 'https://docs.google.com/document/d/1cvHv3L14MjqTQavpnUVRkvDf6z4_Ss5_y60F7xj__mw/edit='
local s = int.getURL(URL)
text=io.popen(s, "w")
text:write(s)
int.destroy()
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: 1668

PostPosted: Tue Jan 07, 2020 5:05 am    Post subject: Reply with quote

Dark Byte wrote:
first find out how to do that with just editing the browser url

once you have that working(only then), then keep in mind you also have to urlencode the text. e.g. you can't have spaces or newlines but have to use their hexadecimal equivalents



This example of how editing url to write on pastebin. I don't how the rule to write on google document.

Code:
url= 'https://pastebin.com/api/api_post.php'  -- this is url provide by pastebin to allows people creating a new paste/file
api_dev_key = '5f6da4d40eadc258f36114eea7adf72a' -- this my developers key on pastebin
api_paste_code='Hello World' -- this is the text to write on pastebin

local int = getInternet()
int.postURL(url,'api_option=paste&api_dev_key='..api_dev_key..'&api_paste_code='..api_paste_code..'')
response = int.postURL(url,'api_option=paste&api_dev_key='..api_dev_key..'&api_paste_code='..api_paste_code..'')
print(response)

-- the good response will be : https://pastebin.com/i9dpQYSR
-- then try open the respose url, 'Hello World' is there



Another example according to Aylin script.

Code:
f = createForm()
f.height = 40
edt = createEdit(f)
btn = createButton(f)
btn.left = edt.left+edt.width+10
btn.caption = 'Resume'

function Write()
 local ad = "Admin: "
 local text = ("\n"..ad.." "..edt.Text)
 url= 'https://pastebin.com/api/api_post.php'  -- this is url provide by pastebin to allows people creating a new paste/file
 api_dev_key = '5f6da4d40eadc258f36114eea7adf72a' -- this my developers key on pastebin
 api_paste_code=text
 local int = getInternet()
 int.postURL(url,'api_option=paste&api_dev_key='..api_dev_key..'&api_paste_code='..api_paste_code..'')
 response = int.postURL(url,'api_option=paste&api_dev_key='..api_dev_key..'&api_paste_code='..api_paste_code..'')
 print(response)
end

f.show()
btn.onClick = Write



Capture.JPG
 Description:
Test Aylin result
 Filesize:  25.1 KB
 Viewed:  5203 Time(s)

Capture.JPG



_________________
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: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Tue Jan 07, 2020 10:23 am    Post subject: Reply with quote

Thanks @Corroder for the alternative.
There are two problems:
1) "Pastebin" is for limited user (can be accessed via optional server and VPN)
"Google Docs" can be accessed without the help of a global server and VPN.
2) I cannot send multiple notes to the link you provided.
I just recorded one note and it doesn't record another note.

Below is a link to PHP code, but I don't know how to interpret it to Lua.

https://developers.google.com/docs/api/quickstart/php



Screenshot_4.jpg
 Description:
 Filesize:  112.4 KB
 Viewed:  5187 Time(s)

Screenshot_4.jpg



Screenshot_3.jpg
 Description:
 Filesize:  104.25 KB
 Viewed:  5187 Time(s)

Screenshot_3.jpg



_________________
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: 1668

PostPosted: Tue Jan 07, 2020 9:43 pm    Post subject: This post has 1 review(s) Reply with quote

Aylin wrote:
Thanks @Corroder for the alternative.
There are two problems:
1) "Pastebin" is for limited user (can be accessed via optional server and VPN)
"Google Docs" can be accessed without the help of a global server and VPN.
2) I cannot send multiple notes to the link you provided.
I just recorded one note and it doesn't record another note.



1. Not understand what mean of 'limited user'?. I doubt people can access it if they don't have 'api_dev_key' for pastebin.
Google doc's, not sure can be accessed via command line, except via Google Scripts App or gDriveCl.

https://olivermarshall.net/how-to-upload-a-file-to-google-drive-from-the-command-line/

2. Send multiple notes to pastebin?. Here example

Code:
f = createForm()
f.height = 40
edt = createEdit(f)
btn = createButton(f)
btn.left = edt.left+edt.width+10
btn.caption = 'Resume'

function Write()
 local ad = "Admin: "
 local text = ("\n"..ad.." "..edt.Text)

 local text2 = [[
 This is a sample multiline text
 which try to write in pastebin
 121323
 43434
 545465767
 bla bla bla bla
 f = createForm()
 f.height = 40
 edt = createEdit(f)
 btn = createButton(f)
 btn.left = edt.left+edt.width+10
 btn.caption = 'Resume'

 Why he said cannot post multiline text?
 ]]


 url= 'https://pastebin.com/api/api_post.php'  -- this is url provide by pastebin to allows people creating a new paste/file
 api_dev_key = '5f6da4d40eadc258f36114eea7adf72a' -- this my developers key on pastebin
 api_paste_code=("\n"..text.." "..text2)
 local int = getInternet()
 int.postURL(url,'api_option=paste&api_dev_key='..api_dev_key..'&api_paste_code='..api_paste_code..'')
 response = int.postURL(url,'api_option=paste&api_dev_key='..api_dev_key..'&api_paste_code='..api_paste_code..'')
 print(response)
end

f.show()
btn.onClick = Write



Last, event use PHP script, when access Google Docs, it will show Google API and also need authethication key code.
Maybe its better to search other pages like google docs, pastebin, tinypaste, etc or creating your own online data storage using SQL.
or is possible use CEServer?.

Good luck

_________________
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: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Wed Jan 08, 2020 2:22 pm    Post subject: Reply with quote

@Corroder your code works fine.
1) Uploading to different connection each time.
2) Now I'm stuck to the limited loading limit.
General purpose: Can CE be written to the remote server with a "note"?
Yes, you coded it is possible, @Corroder. Wink

I need to find some more options on this.
Then I hope I'll bring it up again.

And again +1 @Corroder. Thank you.



Screenshot_7.jpg
 Description:
 Filesize:  67.42 KB
 Viewed:  4908 Time(s)

Screenshot_7.jpg



_________________
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: 1668

PostPosted: Wed Jan 08, 2020 5:40 pm    Post subject: Reply with quote

@Aylin, if I may know, what you want to write to an online site like google docs, pastebin, etc?. Is it plain text, script or database?.
If that is a database, I suggest you search for an online database.

_________________
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: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Wed Jan 08, 2020 9:54 pm    Post subject: Reply with quote

Corroder wrote:
@Aylin, if I may know, what you want to write to an online site like google docs, pastebin, etc?. Is it plain text, script or database?.
If that is a database, I suggest you search for an online database.


It doesn't matter which site we use.
My goal: Send a few words to a single link
and undo this text.
No problem retrieving text (easy with Google Docs)

Code:
form = createForm(true)
form.Width = 310
form.Height = 240

m1 = createMemo(form)
m1.Width = 310
m1.Height = 195
m1.ScrollBars = ssAutoBoth
m1.WordWrap = false

b1 = createButton(form)
b1.Left = 115
b1.Top = 205
b1.caption="Call Text"

b1.OnClick = function()
local url = 'https://docs.google.com/document/d/1cvHv3L14MjqTQavpnUVRkvDf6z4_Ss5_y60F7xj__mw/export?format=txt'
local int = getInternet()
local text1 = int.getURL(url)
int.destroy()
m1.append(text1)
end


But sending text is difficult.
Your solution is sending text, but I can't get it back.

I hope you get a result.

_________________
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: 1668

PostPosted: Thu Jan 09, 2020 1:42 am    Post subject: Reply with quote

To get RAW DATA from pastebin, simple like this:

example:

Code:
local url = 'https://pastebin.com/raw/zNp3j8Zy'
local int = getInternet()
local text = int.getURL(url)
int.destroy()
--load(text)()
print(text)


What you need is to provide pastebin raw data url link.

_________________
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: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Thu Jan 09, 2020 2:44 pm    Post subject: Reply with quote

Approximate solution. But I couldn't adapt it to Lua.

Referance: https://developers.google.com/docs/api/quickstart/php

Example:
Code:
f = createForm()
f.height = 40
edt = createEdit(f)
btn = createButton(f)
btn.left = edt.left+edt.width+10
btn.caption = 'Resume'

function Write()
 local ad = "Admin: "
 local text = ("\n"..ad.." "..edt.Text)
 url= 'https://docs/quickstart/quickstart.php?'  -- this is url provide by pastebin to allows people creating a new paste/file
 documentId = '1cvHv3L14MjqTQavpnUVRkvDf6z4_Ss5_y60F7xj__mw='; -- this my developers key on pastebin
 title=text
 local int = getInternet()
 int.postURL(url,'$documentId='..documentId..'$doc=$service->documents->get($documentId);$printf("'..title..'",$doc->getTitle());')
 response = int.postURL(url,'$documentId='..documentId..'$doc=$service->documents->get($documentId);$printf("'..title..'",$doc->getTitle());')
 print(response)
end

f.show()
btn.onClick = Write


-------------------------------------- Wink
And off-topic: (I'm not sure you're still interested in this, @Corroder)

[[ -- Little program to download files from URLs
-- LuaSocket sample files
-- Author: Diego Nehab ]]

Code: https://github.com/diegonehab/luasocket/blob/master/etc/get.lua

For CE Lua, samples can be taken here.
Diego Nehab our master, very successful in these matters. Smile

_________________
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
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Mon Jan 13, 2020 3:40 am    Post subject: Reply with quote

you can create your own php write/read and host it on 000webhost
_________________
my english is bad
discord : rynx#9828
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Mon Jan 13, 2020 5:31 am    Post subject: Reply with quote

Lynxz Gaming wrote:
you can create your own php write/read and host it on 000webhost


It is possible to create this in C # (Login php etc.)
But you may need to align "API" or "Socket" to do with CE.
Still, I think it might be possible with simple codes. Smile

_________________
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
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