Jump to content


Photo

Dll : Get Battery Level,statu,charging...


  • Please log in to reply
11 replies to this topic

#1 CyberTwister

CyberTwister

    GMC Member

  • GMC Member
  • 246 posts

Posted 29 March 2007 - 09:10 PM

Hi ;)
New dll ! Just hope it's the first one to do this...

List of functions :
get_battery_type()
get_battery_level()
get_battery_percent()
get_battery_lifetime()

A gm6 file is in the zip, with the dll to show you how to use it :
http://www.g-flash.g.....&1=PC Battery

Sure, it works only for laptop computers :D

Edited by CyberTwister, 29 March 2007 - 09:21 PM.

  • 1

#2 BZGaming

BZGaming

    GMC Member

  • New Member
  • 514 posts

Posted 30 March 2007 - 12:58 AM

what is the difference between battery level and battery percent?

BZ
  • 0

#3 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 30 March 2007 - 01:11 AM

(This has been done a few times... to answer your question in your first topic. I don't think the others had some of the functions yours have though.)
  • 0
Posted ImagePosted Image

#4 CyberTwister

CyberTwister

    GMC Member

  • GMC Member
  • 246 posts

Posted 30 March 2007 - 12:01 PM

Ok... I didn't know.

what is the difference between battery level and battery percent?

BZ

<{POST_SNAPBACK}>

All is explain in the scripts...

/*
        ###  get_battery_level  ###
      Return the level of the battery.
      - 0 : medium
      - 1 : High
      - 2 : Low
      - 4 : very low
     
      - 8 : medium and charging
      - 9 : high and charging
      - 10 : low and charging
      - 12 : very low and charging
     
      - 128 : No battery

*/


/*
        ###  get_battery_percent  ###
      Return the percent left in the battery.

*/


Edited by CyberTwister, 30 March 2007 - 12:02 PM.

  • 0

#5 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 31 March 2007 - 10:13 AM

good DLL, but its already been done with more features
  • 0

Chris Matthews, Co-Leader of Digital X

#6 hypnotoad1579

hypnotoad1579

    GMC Member

  • New Member
  • 12 posts

Posted 07 April 2007 - 05:59 PM

this DLL is the G!!! Im gonna use it in my mini OS that im making. (you will be given full credit for the DLL :GM6: ) your DLL is soooo pimp! it works even better if you add a step event with the draw and create actions that way it keeps updated. ^_^ you should add it to your download ;) :GM045: :D :D :D .
  • 0

#7 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 09 July 2007 - 07:10 AM

There's a problem with the get_lifetime() function. It returns the minutes, but not the hours. I had 2 hrs 25 mins left of battery life, and it returned just 25 instead of 2 hrs 25 mins (which would be 145 mins)...

-IMP :) :GM080:
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#8 gamereality

gamereality

    GMC Member

  • GMC Member
  • 577 posts
  • Version:GM:Studio

Posted 09 July 2007 - 11:56 AM

It doesn't work for PCs at all, obviously, but you need to add a function to check whether they're using a laptop.
  • 0

#9 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 09 July 2007 - 12:11 PM

check my host-a.net page gamreality, mine works with desktops. although, this works for my desktop...
  • 0

Chris Matthews, Co-Leader of Digital X

#10 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 09 July 2007 - 07:28 PM

It doesn't work for PCs at all, obviously, but you need to add a function to check whether they're using a laptop.

<{POST_SNAPBACK}>

Check the battery level. If it return 128, there's no battery, so it must be a desktop.

But the lifetime still is inaccurate.

-IMP ;) :)
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#11 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 09 July 2007 - 08:37 PM

It doesn't work for PCs at all, obviously, but you need to add a function to check whether they're using a laptop.

<{POST_SNAPBACK}>

Check the battery level. If it return 128, there's no battery, so it must be a desktop.

But the lifetime still is inaccurate.

-IMP ;) :)

<{POST_SNAPBACK}>

A laptop can run without a battery.
  • 0

#12 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 09 July 2007 - 10:34 PM

That's true...if it's on AC Power... Nevermind, then, forget I said that :) .

-IMP ;) :)
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: