-
Posts
4 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Posts posted by HajraLegacy
-
-
23 minutes ago, HajraLegacy said:
@Xiija well I actually used what you said in earlier posts to get to where I am with this script, so much appreciated for that. I'll have a look at this video but I'm not certain it'll help me out if I am not that knowledgeable about code in general lol.
I guess I'm not certain how I can get multiple results with multiple llHTTPRequest 's and .. http_response if's. I used your method with the markers to get a good, solid key that I want but with the separate request, it keeps spitting out the same key even though I've assigned a different url, etc to that response. Any ideas what I can do with that? I've worked so many hours on this script (I was originally trying to use notecards but that wasn't working with me either.) @Xiija
-
@Xiija well I actually used what you said in earlier posts to get to where I am with this script, so much appreciated for that. I'll have a look at this video but I'm not certain it'll help me out if I am not that knowledgeable about code in general lol.
-
Hi there, @Xiija. I have been following along with the Google Sheets data storage method and got at least one URL to work (Kinda), but I cannot for the life of me get a second one to work. Can anyone help me? I read that you should wait at least 60 seconds for the next request, which is fine - However I noticed that even when defining my separate URLs, I receive the same response from the first URL even though I am requesting data from an entirely different cell. What do I do? (FYI I am not very script savvy, but I try!)
On 2/15/2019 at 6:04 PM, Xiija said:so, a kinda hacky trick... when you send your data to the form, use a "marker"
your marker could be anything.. like .... ~start~ or .... ~end~
in this example, i used something easy to find.... @!@ ..... was my marker.
so if the data you send is ...." HTTPtest 2-16-2019" ... just add your marker to that to get...
@!@HTTPtest 2-16-2019
on the sheet, my cell ... ( c6) ...looked like this ....
@!@HTTPtest 2-16-2019
string sheetID = "1MNKwhVqK8U8urzTWa_q0YtlGnYVn7SnICZBylstR2KE"; string sheetURL = "https://docs.google.com/spreadsheets/d/1MNKwhVqK8U8urzTWa_q0YtlGnYVn7SnICZBylstR2KE/pubhtml?gid=653993593&single=true&gid=0&output=txt&range=C6"; key selfCheckRequestId; default { state_entry() { } touch_start(integer total_number) { selfCheckRequestId = llHTTPRequest( sheetURL, [HTTP_METHOD, "GET", HTTP_VERBOSE_THROTTLE, FALSE, HTTP_BODY_MAXLENGTH, 16384], ""); } http_response(key id, integer status, list metaData, string body) { if (id == selfCheckRequestId) { string marker = "@!@"; integer start = llSubStringIndex(body,marker); integer end = llSubStringIndex(body, "</td>"); string fetch = llGetSubString(body,start + llStringLength(marker), end-1); llOwnerSay("\n response: \n" + fetch); } } }
the inworld response from putting this code in a box and touching it was...
the value of cell c6 (with the marker bit removed)
as i said , this is hacky ... it may break depending on where "</td>" appears on the sheet...
you ~could~ add an ending marker to your sent data ... mebbe it would look like ... @!@HTTPtest 2-16-2019 @!!@
to make is more safe to parse?
the NEW google stuff has an API ( you have to get a key) ... https://developers.google.com/sheets/api/
storing data
in LSL Scripting
Posted
@XiijaI'm definitely going to look into this more and hopefully share some results