A small community I am part of speedrun a particular race in GTA 5, and we have a Google Spreadsheet where we track split times for the various car records.
I would like to create a command via Nightbot where I could type “!9f” or “!Infernus” etc for any of the cars, and it would return all of the split times for that car, potentially with the column heading before each one. E.g. "9f: Highway: 2:42, Wheelspin: 2:54…
The issue is I have absolutely no coding knowledge to implement this myself. Would anybody we willing to help me set this up?
endpoints
/ - gives json of sheet
/rf - same as /
/cf - same but gives in format of coloumn first
/r/n - n is the index. gives n’th row
/c/n - n is the index. gives n’th coloumn
attributes
id - id of the sheet, - IMPORTANT
sheet_id - index of sheet to work on. defaults to 0
Thank you for the effort you’re putting into this! If it makes it easier I’m very unlikely to be grabbing any times outside of the top 60 or 70.
I can also see that the current command just grabs the overall speedrun time. Whilst that is definitely useful (maybe a seperate command like !time insert vehicle here), the main purpose I was envisioning was to show the split times from column G-Q. Does that look like it will be possible?
Since I now know how to eval pastebin code. I think sky is the limit now.
here’s how it looks with sheet_no=0
that it can search with leading words.
don’t add this right now. I am a little confused why my script can’t get any more cell values that is from G to Q. I will have to look at my base code for this.
I think you want something like this if am not wrong
user - !search 9f
nightbot - RBSReece - 15:58.324 Highway-2:42, Wheelspin-2:54, Quarry CP-3:55, Hospital Line-5:38, Airport CP-6:31, Route 68-8:43, Chilliad CP-10:52, Off T. Tracks-12:25, Observ. CP-13:37, Zancudo Exit-14:54, Finish-15:58
it is possible if i can fix the first bug in first place ngl.
I really can’t invest more time into this. as i have exam tomorrow.
I am using the sheet named split. as it worked fine with it.
you can read the rest of the hidden code https://pastebin.com/raw/X4vaUgKF
This is fantastic, I really appreciate all of the work you’ve put in here. Thank you so much. So do I just need to copy the $(Eval)… section into a command in Nightbot and it should work?
I’ve noticed that the command seems to not be working as expected - when the command shows the additional split times after the “Highway” split, it appears to show them as how much additional time they are compared to the previous time (e.g Highway 2:42, Wheelspin 0:12) when it should show each time individually (so Wheelspin should be 2:54).
I’d also like to clean up the formatting to make it look a bit nicer in chat, but I’m not sure how I’d go about that.
You also mentioned hosting the API on my own server. I don’t have a server - is there any way of hosting it on my own PC? And if so, how would I do that? I assume that would result in the command only working if my PC is turned on? I’m generally good with computers but I have absolutely 0 coding knowledge so all of this is very foreign to me.
EDIT: You mentioned you’re grabbing from the “Splits” spreadsheet - that is probably why they aren’t showing correctly, as that’s how they are displayed on that sheet. The “Times” or “Times Clean” sheet has the preferred layout of times to be displayed in the command
no you can’t just start the program on your computer and expect it to work. its way more complex than that. you have to take care of firewall and open a port (54321 in this case). in the end its just not possible to host it on your own computer.
I am not deleting it from my server anytime soon. so you are probably fine.