4 Replies Latest reply on Aug 3, 2006 8:57 AM by tdriley

    BuddyAPI

    tdriley Level 1
      I'm building a system analyser using the buddyAPI xtra to return CPU info when the user clicks on certain buttons... sounds easy, but i keep getting script errors when I try to detect anything except the CPU vendor - Type, Model, Stepping and Speed will throw up an error!

      Here's some of my code:
      ------------------------------------------------------------------------------
      on mouseUp me

      set CPU_type = baCpuInfo( "type" )

      member("CPU_type").text = CPU_type

      end
      ------------------------------------------------------------------------------


      Anyone know what's up?

      Thanks
        • 1. Re: BuddyAPI
          Level 7
          It would be helpful to know what the error is that you are getting. My
          guess is that you are getting an error saying Script Error: String
          Expected. If that is the case, then the problem is that many of the
          baCpuInfo commands return an integer. You can not set the .text of a
          member to an integer, as text fields need to be strings. Som try this
          code instead:


          on mouseUp me

          set CPU_type = baCpuInfo( "type" )

          member("CPU_type").text = string(CPU_type)

          end
          • 2. Re: BuddyAPI
            tdriley Level 1
            Yeh - that was the error - have converted to strings and it works fine

            Thanks!
            • 3. Re: BuddyAPI
              Level 7
              One thing to be careful of is that the BuddyAPI documentation came out a
              year and a half ago, and though the command baCpuInfo("type") will work
              properly, you may get results that are not covered in the manual. For
              instance, I just noticed that when I run it,

              put baCpuInfo("vendor")
              -- "AuthenticAMD"

              put baCpuInfo("type")
              -- 15

              put baCpuInfo("model")
              -- 3

              I am running an AMD Athlon64 X2. You will probably need to come up with
              some way of translating the newer processor types. Or you may want to
              send Gary (the fellow that made the xtra) an email asking for a more up
              to date list. His contact info is on the BudAPI website.
              • 4. Re: BuddyAPI
                tdriley Level 1
                Great, I will do that.

                Thanks for pointing it out.

                T