Skip to content
TORNLIFE More

Need help from an Coder

Started by NumerableRED01 [2236401] on in API Development.

10 replies · 222 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 11 / 11 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
11
Discussion span
→
People posting
8
Likes on archived posts
17
Posts by staff, officers and moderators
1
Authority score
72 / 100
Historical score
24 / 100
Story score
35 / 100
Engagement score
58 / 100

Most-liked replies

Mentioned in this thread

Father [2131687] ×2

NumerableRED01 [2236401]
Hey!
I'm starting to get interested in making something with API's and Google Sheets.
I'm hoping to find someone with a lot of experience or knowledge that would be willing to answer a few questions and point me in the right direction, I'd really appreciate it!

Please chat me!! :)

So a little background example on what I'm doing so far.
I'm trying to get the price of beer at 12:00 and 00:00 everyday and make a database to see the average price, highest price, lowest price, and most used price.
I have already made this happen but I have to Manually list the prices, I'm hoping there's someway or formulas on Google Sheets to make this easier!

Thanks to anyone willing to help!
-NumerableRED01
lamashtu [2001015]
Super shame your faction leader hasn't spent half his free time the last 8 months coding against Torn's API... otherwise he could probably help you.
Helcostr [1934501] Wiki Editor
Doing cron jobs in Google App Scripts is a bit tricky, since defining an hour to run at doesn't mean that it will run at the exact time you requested.
Father [2131687]
You can. I mean not by the conventional means but by using some creativity. Just run the script every minute And get the current time.

if(time == ) {
//Whatever
}
Helcostr [1934501] Wiki Editor
That, i believe, will use up your quota fast, so i didnt think this was "viable" :3

edit: come to think of it, it's such a small run time, maybe not.
DeKleineKobini [2114440] Committee Committee
I find the quota on trigger runtime quite confusing.

It does say '90 min / day', which equals about 3,75 seconds every minute.
I have a function that triggers every minute and takes from 4,5s to 7,5s and it's not even the only trigger on that script/spreadsheet, let alone my account. But I also never had it give me a problem.
xedx [2100735]
This won't suck up your quota limit. If I interpreted correctly what Sid [2131687] said. if you do something like this very primitive pseudo-code, you won't be using the Torn API at all, except for the requested times, meaning twice a day. I'd probably want to run this every minute, since you're testing for a 1 minute interval.

var today = new Date();
if (today.getHours() == 0 && today.getMinutes() == 0 ||
today.getHours() == 12 && today.getMinutes() == 0) {
// ...do stuff with the Torn API
} else {
// Don't do anything. No Torn API call this minute.
return;
}



I may not have answered the original question that was asked, if not, PM me. I've written a bunch of scripts that interact with Google Sheets.
Or post here, but I might not notice it for days, but I'll go ahead and subscribe to this thread so the chances are more likely :-)

Edit: dawned on me later you were referring to the Google quota, not the Torn API quota...

Mentions: Father [2131687]

GrimRazor [1776608]
You go n00bie it's refreshing to see such ambition and a desire to help others.Just hope the other n00bs can learn from UR example.