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

#1 2011-08-26 16:46:56

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Can squeak detect if your laptop is plugged into an outlet?

^Title^

I need to know.

If it does, can sombody give me a code for a "laptop plugged in?" block?

That will help a lot.

And, if, again, the squeak is able to do the above, can it detect if you are on a laptop or a computer?

Then I'm going to need a "on a laptop?" block, and a "on a computer" block.

Thanks for anyone who can help.

Offline

 

#2 2011-08-26 17:17:43

PandaGuy
Scratcher
Registered: 2010-01-10
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

You need a mouse for that, man...  tongue

...and maybe some cheese.

Last edited by PandaGuy (2011-08-26 17:18:10)


http://24.media.tumblr.com/tumblr_mc1q6mZho11rcdvg5o1_500.gif

Offline

 

#3 2011-08-26 17:18:32

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

It's an interesting idea. I think you may have to resort to coupling Scratch with Python using remote sensor connections. I know that someone used a Scratch/Python coupling to program a scratch game that used the tilt-sensors built into the laptop to move a ball around the stage so I think Python should be able to pull the sort of information you need. Squeak, on the other hand, does not strike me as the sort of language that will manage to do what you're asking. I'm no expert though, it may be entirely possible, I suggest looking at the squeak forums and the Python forums and see what you find there!

PandaGuy wrote:

You need a mouse for that, man...   tongue

...and maybe some cheese.

What?

Last edited by sparks (2011-08-26 17:19:33)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2011-08-26 18:16:07

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

sparks wrote:

It's an interesting idea. I think you may have to resort to coupling Scratch with Python using remote sensor connections. I know that someone used a Scratch/Python coupling to program a scratch game that used the tilt-sensors built into the laptop to move a ball around the stage so I think Python should be able to pull the sort of information you need. Squeak, on the other hand, does not strike me as the sort of language that will manage to do what you're asking. I'm no expert though, it may be entirely possible, I suggest looking at the squeak forums and the Python forums and see what you find there!

Hmm, Python.

I've only head of Python as the thing you have to download to get Blender to work.

Meh, learn somthing new every day.

Thanks, though. That kinda helped. Idk how Python works, but I can learn.

Last edited by owetre18 (2011-08-26 18:16:57)

Offline

 

#5 2011-08-27 04:02:24

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

Actually, I think you can.
Squeak is able to manage DLLs (proof in the Plugins), so it should be able to manage the query to kernel32.dll (required to use the GetSystemPowerStatus API).

I'm sure it would take a lot of work and isn't really worth it.

Offline

 

#6 2011-08-27 04:04:38

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

Oh, for those interested in details of the API, here's the link to the documentation  smile

Offline

 

#7 2011-08-27 18:18:37

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

LS97 wrote:

Actually, I think you can.
Squeak is able to manage DLLs (proof in the Plugins), so it should be able to manage the query to kernel32.dll (required to use the GetSystemPowerStatus API).

I'm sure it would take a lot of work and isn't really worth it.

Thanks for the help.

Offline

 

#8 2011-08-27 19:09:08

PandaGuy
Scratcher
Registered: 2010-01-10
Posts: 1000+

Re: Can squeak detect if your laptop is plugged into an outlet?

sparks wrote:

It's an interesting idea. I think you may have to resort to coupling Scratch with Python using remote sensor connections. I know that someone used a Scratch/Python coupling to program a scratch game that used the tilt-sensors built into the laptop to move a ball around the stage so I think Python should be able to pull the sort of information you need. Squeak, on the other hand, does not strike me as the sort of language that will manage to do what you're asking. I'm no expert though, it may be entirely possible, I suggest looking at the squeak forums and the Python forums and see what you find there!

PandaGuy wrote:

You need a mouse for that, man...   tongue

...and maybe some cheese.

What?

*cries* You don't get it! D:


http://24.media.tumblr.com/tumblr_mc1q6mZho11rcdvg5o1_500.gif

Offline

 

#9 2011-08-27 19:18:08

johnathandd
Scratcher
Registered: 2011-04-24
Posts: 100+

Re: Can squeak detect if your laptop is plugged into an outlet?

I don`t think it can, sorry.

PandaGuy wrote:

You need a mouse for that, man...  tongue

...and maybe some cheese.

xD


http://www.cartridgeworld.com/uploadedImages/Environment/environment_banner.jpg

Offline

 

Board footer