Jump to content
  • 0

Online Table


MAARS

Question

Hi guys i am facing some problems with online table. I am want to save a table in pastbin and then when i run the Script he make a request and generate the table.

but the problem is the request is not generating my table like i want.

This is the table i save in pastbin 

20201206_122630.thumb.jpg.28cff55df797308677394bda366617ab.jpg

 

this is the code to generate the saved tab in pastbin

tbl = {gg.makeRequest("https://pastebin.com/raw/WJspn1sT").content}

print(tbl) -- I used print to see how is my table

 

but he is returning this

20201206_123706.thumb.jpg.59b7fbb682df674ea49dcd279695f3b4.jpg

The table contains only one item, only the first one us considered.

i want him to consider all not only the first one.

THIS IS THE RESULT I WANT

20201206_124204.thumb.jpg.880c228a23685a61f1853ed51e728746.jpg

Sorry for bad English I do my best to improve my English. Thanks everyone.

20201206_123528.jpg

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

On 12/6/2020 at 11:43 AM, MAARS said:

tbl = {gg.makeRequest("https://pastebin.com/raw/WJspn1sT").content} print(tbl) -- I used print to see how is my table

First, you have to understand what this had done. This is the function to extract content from a particular website. It read the content in the pastebin and return as a string, so no matter what form you typed in pastebin will return as string instead of "automatically" transform into table for you.

 

To turn this into table, use a self made function.

ipAddress = [["192.168.0.1",
"194.765.8.3",
"77.203.106.56",
"77.204",
"74.728.026.09",
]] 
function strToList(str) 	--[[ 	Transform string into a list. 	]] 	local list = {}; 	string.gsub(str, "\"(.-)\",\n", function(x) list[#list+1] = x end); 	return list;
end 
print(strToList(ipAddress));

 

If you are interested in these, learn "regular expression" and "function".

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.