This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-05-21 17:00:14

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

I need help...

What's the most efficient way to make a script that detects if a project is being run online or offline? It has to be able to set a variable to 'offline' or 'online'.


I tested out RHY's way, he includes it in the stage in his Jelly project, but it didn't work. Dazachi's won't work for me. Help!


-End Transmission-

Offline

 

#2 2010-05-21 17:03:37

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: I need help...

I think dividing by 0 won't work offline, but will work online. Then you can just use this: just make sure it's all in it's own script!

Code:

set [online?] to (0)
set [dummy] to ((15) / (0))
set [online?] to (1)

The last block of the script won't execute if it's offline.

Offline

 

#3 2010-05-21 17:15:06

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: I need help...

@coolstuff: You really deserve to be a mod! Thanks so much!


-End Transmission-

Offline

 

#4 2010-05-21 17:15:51

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: I need help...

iCode-747 wrote:

@coolstuff: You really deserve to be a mod! Thanks so much!

Thanks! And it's no problem!

Offline

 

Board footer