Jump to content


Photo

getsteamid64?


  • Please log in to reply
5 replies to this topic

#1 greenpig

greenpig

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 11 January 2018 - 10:58 PM

how to use this to get bot steam id?



#2 TomYoki

TomYoki

    Advanced Member

  • Member
  • PipPipPip
  • 82 posts
  • LocationRiga, Latvia

Posted 12 January 2018 - 05:25 AM

If you want to get the SteamID of the user currently signed in,

You can use following: (Client being steam-user instance)

client.steamID;
client.steamID.getSteamID64()
client.steamID.getSteam3RenderedID()

// Function names should be self-explanatory



#3 greenpig

greenpig

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 13 January 2018 - 03:27 AM

If you want to get the SteamID of the user currently signed in,

You can use following: (Client being steam-user instance)

client.steamID;
client.steamID.getSteamID64()
client.steamID.getSteam3RenderedID()

// Function names should be self-explanatory

thanks also i want to ask i tried to use this 

var userinfoapi = 'http://backpack.tf/a...o/v1?steamids='+ client.steamID.getSteamID64() + '%2C76561198070299574&key=' + config.bptftoken; 

 

it output this 

var userinfoapi = 'http://backpack.tf/api/users/info/v1?steamids=' + client.steamID.getSteamID64() + '%2C76561198070299574&key=' + config.bptftoken;
                                                                                   ^

TypeError: Cannot read property 'getSteamID64' of null
    at Object.<anonymous> (C:\steambot\bot.js:107:84)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:148:9)
    at bootstrap_node.js:542:3
    at processImmediate [as _immediateCallback] (timers.js:611:5)
[Finished in 2.009s]


TypeError: Cannot read property 'getSteamID64' of null at [stdin]:107:84 at ContextifyScript.Script.runInThisContext (vm.js:23:33) at Object.runInThisContext (vm.js:95:38) at Object.<anonymous> ([stdin]-wrapper:6:22) at Module._compile (module.js:571:32) at Immediate.<anonymous> (bootstrap_node.js:392:29) at runCallback (timers.js:666:20) at tryOnImmediate (timers.js:639:5) at processImmediate [as _immediateCallback] (timers.js:611:5) 
[Finished in 2.009s]

TypeError: Cannot read property 'getSteamID64' of null at [stdin]:107:84 at ContextifyScript.Script.runInThisContext (vm.js:23:33) at Object.runInThisContext (vm.js:95:38) at Object.<anonymous> ([stdin]-wrapper:6:22) at Module._compile (module.js:571:32) at Immediate.<anonymous> (bootstrap_node.js:392:29) at runCallback (timers.js:666:20) at tryOnImmediate (timers.js:639:5) at processImmediate [as _immediateCallback] (timers.js:611:5)

[Finished in 2.009s]


#4 TomYoki

TomYoki

    Advanced Member

  • Member
  • PipPipPip
  • 82 posts
  • LocationRiga, Latvia

Posted 13 January 2018 - 02:35 PM

I am not completely sure why this happens,

however this may happen if you're attempting to get it before cookies have been set.

 

Attempt to fire the function when you have set cookies & sessionID.



#5 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,721 posts

Posted 13 January 2018 - 05:54 PM

Yeah you're trying to read it before you're logged on.



#6 greenpig

greenpig

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 15 January 2018 - 05:08 AM

I am not completely sure why this happens,

however this may happen if you're attempting to get it before cookies have been set.

 

Attempt to fire the function when you have set cookies & sessionID.

still not working any other way?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users