MC874 Posted March 25, 2023 Posted March 25, 2023 Hi @slaimmials, What "load variable" means here? Kinda confused with the way you wording the sentence. Is it Variable that parts of Online Script? or Variable here means String? [ Online Script ] Let's say you're trying to get 'Variable', which is inside a script, isn't it? You must change the literal Variable into returning values inside the Online Script. variable = 'abogoboga' -- x: wrong return 'abogoboga' -- v: correct then you can do some Request into the HTTP Site: http_content = gg.makeRequest(link).content load_content = load(http_content)() [ Webscrape ] Another thing is to get literal String from HTTP Site, which is part of Webscraping. If the HTTP Site content is RAW (no HTML, attachment or attributes) then you can just do usual Request: --Taking content from RAW Pastes or Github github_content = gg.makeRequest('https://raw.githubusercontent.com/gilts/wsee/main/.wsee/CONFIG') print(github_content) Most websites has HTML to define the web structure, thus you need to parse it manually. LUA isn't really powerfull for this kind of stuff but it is still sufficient using in-built tools: - :gmatch: Return Matches and Iterate the Result. - :match: Return Captures from the first Match. - :find: Return First Match and Position. - :gsub: Subtitutes / Replacement for Matches For example, we want to get the IP address from the following website: hostmap web_content = gg.makeRequest('https://suip.biz/?act=hostmap').content --Returns HTML for i in web_content:gmatch('([^;">]+)</li>') do --Parse HTML: Find Matches for i in i:gsub("[%c%s]",""):gmatch('%d+%.%d+%.%d+%.%d+') do --Parse HTML: Matches IP Pattern print(i) --Print Result end end Read more about this: LUA Capture and makeRequest
BadCase Posted March 25, 2023 Posted March 25, 2023 You can use the PasteBin API I just made to do this easily Create a paste containing the variables and then use this to load them into currently running script load(pasteBin.getPasteRaw("LFshihBT"))() --replace "LFshihBT" with your pastes key BadCase's PasteBin API (#72l4i839)
slaimmials Posted March 25, 2023 Author Posted March 25, 2023 8 hours ago, MC189 said: Hi @slaimmials, What "load variable" means here? Kinda confused with the way you wording the sentence. Is it Variable that parts of Online Script? or Variable here means String? [ Online Script ] Let's say you're trying to get 'Variable', which is inside a script, isn't it? You must change the literal Variable into returning values inside the Online Script. variable = 'abogoboga' -- x: wrong return 'abogoboga' -- v: correct then you can do some Request into the HTTP Site: http_content = gg.makeRequest(link).content load_content = load(http_content)() [ Webscrape ] Another thing is to get literal String from HTTP Site, which is part of Webscraping. If the HTTP Site content is RAW (no HTML, attachment or attributes) then you can just do usual Request: --Taking content from RAW Pastes or Github github_content = gg.makeRequest('https://raw.githubusercontent.com/gilts/wsee/main/.wsee/CONFIG') print(github_content) Most websites has HTML to define the web structure, thus you need to parse it manually. LUA isn't really powerfull for this kind of stuff but it is still sufficient using in-built tools: - :gmatch: Return Matches and Iterate the Result. - :match: Return Captures from the first Match. - :find: Return First Match and Position. - :gsub: Subtitutes / Replacement for Matches For example, we want to get the IP address from the following website: hostmap web_content = gg.makeRequest('https://suip.biz/?act=hostmap').content --Returns HTML for i in web_content:gmatch('([^;">]+)</li>') do --Parse HTML: Find Matches for i in i:gsub("[%c%s]",""):gmatch('%d+%.%d+%.%d+%.%d+') do --Parse HTML: Matches IP Pattern print(i) --Print Result end end Read more about this: LUA Capture and makeRequest thx
XEKEX Posted March 26, 2023 Posted March 26, 2023 some_text = [[ print('text have been loaded') ]] result,err = pcall(load(some_text,'t')) -- t as 2ed parameter to load will load string same as loadstring() result,err = pcall(load(some_text,'b')) -- assume that some_text is a binary code ( compiled ) the 'b' will load it as binary result,err = pcall(load(some_text,'bt')) -- bt will load it either it's a text or a binary if result then result() end -- add () to execute the code -- if it's a value use tostring / tonumber to modify the type of this variable to prevent error
Question
slaimmials
maybe loadstring ()?
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.