- ComputerCraft | Programmable Computers for Minecraft
- → lolmaker2002's Content
lolmaker2002's Content
There have been 21 items by lolmaker2002 (Search limited from 29-March 23)
#265365 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 04 March 2017 - 10:11 PM in Ask a Pro
#265344 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 04 March 2017 - 03:42 AM in Ask a Pro
Incinirate, on 04 March 2017 - 03:29 AM, said:
lolmaker2002, on 04 March 2017 - 02:45 AM, said:
Bomb Bloke, on 04 March 2017 - 02:35 AM, said:
It's generally bad practise to post and readAll all in one go. Doing so means you're unable to close the final handle, as you didn't hang on to its pointer anywhere.
In regards to your stated problem, it's possible that you need to make your string URL-safe:
local handle = http.post( textutils.urlEncode( "http://krist.ceriat.net/transactions?to=k5n6r931i1&privatekey=xxxxxxxx&amount="..payamm.."&metadata=test" ) ) local pay = handle.readAll() handle.close() print(pay)
this just returns a nil value index attempt error. it might not be able to find the url? (im quite new to working with the HTTP API)
Yeah you're using the http post method incorrectly, the correct usage is this:
http.post(url, postData)so in your case
http.post("http://krist.ceriat.net/transactions", "to=k5n6r931i1&privatekey=xxxxxxxxx&amount=" .. payamm .. "&metadata=test")
#265339 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 04 March 2017 - 12:47 AM in Ask a Pro
#265313 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 03 March 2017 - 04:25 AM in Ask a Pro
#265306 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 03 March 2017 - 02:54 AM in Ask a Pro
Program:
https://hastebin.com/yolorapeco.lua
--EDIT: thought i might link the API documentation of the Krist currency aswell: http://krist.ceriat.net/docs/
--EDIT2: this is the output i get when i run it:
{"ok":true,"address":{"address":"k5n6r931i1","balance":0,"totalin":612,"totalout":4726,"firstseen":"2016-12-02T21:10:56.000Z"}}
#265340 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 04 March 2017 - 02:09 AM in Ask a Pro
so, i've been trying to make a transaction through computercraft, since im working on a shop, but whenever i try to pass my privatekey through the http.post, it just errors the following:
{"ok":false,"error":"missing_parameter","parameter":"privatekey"}
even tho i posted the key with the http.post
code used to send request:
pay = http.post("http://krist.ceriat.net/transactions?to=k5n6r931i1&privatekey=xxxxxxxx&amount="..payamm.."&metadata=test").readAll() print(pay) -- checking for errors
if there is anything im doing wrong here please tell me, i've been looking over the internet for more than an hour.
Krist Documentation: http://krist.ceriat.net/docs
#265342 trying to convert string gotten from HTTP.GET to table
Posted by lolmaker2002 on 04 March 2017 - 02:45 AM in Ask a Pro
Bomb Bloke, on 04 March 2017 - 02:35 AM, said:
It's generally bad practise to post and readAll all in one go. Doing so means you're unable to close the final handle, as you didn't hang on to its pointer anywhere.
In regards to your stated problem, it's possible that you need to make your string URL-safe:
local handle = http.post( textutils.urlEncode( "http://krist.ceriat.net/transactions?to=k5n6r931i1&privatekey=xxxxxxxx&amount="..payamm.."&metadata=test" ) ) local pay = handle.readAll() handle.close() print(pay)
this just returns a nil value index attempt error. it might not be able to find the url? (im quite new to working with the HTTP API)
#265500 trying to convert PNG to drawable image
Posted by lolmaker2002 on 11 March 2017 - 03:27 PM in Ask a Pro
if anyone could like me a API or something that could help me further, that would be kindly appreciated!
(if your wondering why, i found a website that will generate QR codes with a http.get request, and will download the image)
#265380 Titanium - Graphical User Interface (GUI) Framework [Beta 1] - XML
Posted by lolmaker2002 on 05 March 2017 - 05:28 AM in APIs and Utilities
#265130 Please Delete.
Posted by lolmaker2002 on 26 February 2017 - 03:27 PM in Servers
Programming for: over 2 years. (not to active on forums tho)
#265498 PasteUpdate: A simple way of implementing updating into your program
Posted by lolmaker2002 on 11 March 2017 - 03:20 PM in APIs and Utilities
#268611 Krist - Minable currency that works across servers (paste updated)
Posted by lolmaker2002 on 27 July 2017 - 01:00 PM in Programs
#271343 Krist - Minable currency that works across servers (paste updated)
Posted by lolmaker2002 on 28 October 2017 - 02:58 PM in Programs
https://www.kristminer.cf
It's a simple website on which you can essentially mine KST with your CPU at about the same speed as someone with a GPU.
Donations are always welcome: kmineqokuz
Beeskee, on 24 August 2017 - 11:43 PM, said:
And it works with http instead of https - This is running on an older client/server pair so I can't change anything else.
Edit: Anyone know what PaySafeKrist is?
I found the Krist API for it: https://github.com/atenfyr/kristapi
but not the generator API
Lgaming, on 02 September 2017 - 04:12 PM, said:
Beeskee, on 24 August 2017 - 11:43 PM, said:
And it works with http instead of https - This is running on an older client/server pair so I can't change anything else.
Edit: Anyone know what PaySafeKrist is?
I found the Krist API for it: https://github.com/atenfyr/kristapi
but not the generator API
I found this compiled PaySafeKrist program, decompile it and maybe you may find something useful. https://pastebin.com/nW2KGF7C
Lignum, on 04 September 2017 - 08:22 PM, said:
Lgaming, on 02 September 2017 - 04:12 PM, said:
Beeskee, on 24 August 2017 - 11:43 PM, said:
I found this compiled PaySafeKrist program, decompile it and maybe you may find something useful. https://pastebin.com/nW2KGF7C
No need to decompile, I found this by just googling.
PaySafeKrist is a program of mine. it's a PaySafeCard clone for the Krist cryptocurrency. you can try it out if you want.
And Beeskee, i did not use atenfyr's API, i used mine: github.com/lolmaker2002/luakrist
#271347 Krist - Minable currency that works across servers (paste updated)
Posted by lolmaker2002 on 28 October 2017 - 07:32 PM in Programs
SquidDev, on 28 October 2017 - 03:52 PM, said:
lolmaker2002, on 28 October 2017 - 02:58 PM, said:
https://www.kristminer.cf
It's a simple website on which you can essentially mine KST with your CPU at about the same speed as someone with a GPU.
This also get's rid of having to log in on every page. (since it makes a cookie for the PHP session)
EDIT: I also want to note that i keep track of nothing, except the stats i can see on coinhive.
This includes: The date you mined your first hash, your account name (your address) and how many hashes you have mined in total.
#266214 Krist - Minable currency that works across servers (paste updated)
Posted by lolmaker2002 on 10 April 2017 - 04:28 PM in Programs
#266220 Krist - Minable currency that works across servers (paste updated)
Posted by lolmaker2002 on 11 April 2017 - 12:30 AM in Programs
3d6, on 10 April 2017 - 04:41 PM, said:
Herobrine2Nether, on 31 March 2017 - 05:03 PM, said:
100000 is the easiest possible work number (larger is easier)lolmaker2002, on 10 April 2017 - 04:28 PM, said:
We don't expect any data loss
#268504 Krist - Minable currency that works across servers (paste updated)
Posted by lolmaker2002 on 24 July 2017 - 12:54 PM in Programs
#262359 CCFormat - A simple way to format your current computer
Posted by lolmaker2002 on 30 November 2016 - 06:02 PM in APIs and Utilities
#262358 CCFormat - A simple way to format your current computer
Posted by lolmaker2002 on 30 November 2016 - 05:52 PM in APIs and Utilities
Ale32bit, on 30 November 2016 - 05:46 PM, said:
--CCFormat, made by lolmaker2002 print("THIS PROGRAM WILL COMPLETELY WIPE YOUR DRIVE!") print("if this action is purposely done, press enter") print("else, hold CTRL+T") read() for k, v in ipairs(fs.list("")) do fs.delete(v) end
EDIT: i've been using computercraft for a long while now but i still dont get half of it, i usually just get lucky with my programs and just roll with it.
#262353 CCFormat - A simple way to format your current computer
Posted by lolmaker2002 on 30 November 2016 - 03:56 PM in APIs and Utilities
i also wrote this when i had to go, so i cant add screens or anything, file is in desc
PASTEBIN URL: AaWnayNL
EDIT: this was also a little test for me to see if i could work with tables (never worked with them before, or at least not intensively) and i think it worked out pretty well.
#265624 [2019] [1.12.2] [Survival] LurCraft : We're back, and better than ever!
Posted by lolmaker2002 on 17 March 2017 - 10:40 PM in Servers
IGN: lolmaker2002
Programming knowledge: 7.5-8
Age (optional): (rather not)
- ComputerCraft | Programmable Computers for Minecraft
- → lolmaker2002's Content