IPv4 Fremnet Logo
TOOLS, TINKERINGS & CODE

Good code yeh?

Add node servers · Mar 13, 20:26 by Shannon Wynter

Recently I’ve had a problem where steam seems to forget my fav servers, especialy after a crash… and I’m tired of re-entering them.

I wrote an autoit script to re-add them all, then thought you might enjoy it.

You DO need autoit to run the script, you can get it Over here

Anyway the script goes something like

  1. #Run script with Servers window open to the Favourites page
  2. #Updated - Added DOD and BG mods (Dunno how they got missed)
  3.  
  4. AutoItSetOption("MouseCoordMode", 0)
  5. AutoItSetOption("SendKeyDelay",1)
  6. Opt("WinTitleMatchMode", 3)
  7.  
  8. $Answer = msgbox(65,"Node Servers","This script will automaticly add Nodes servers to the Steam Favourites" & @LF & "Please be sure to have Steam Servers open to the Favourites page" & @LF & "DO NOT touch your KB/Mouse till this script is finished")
  9.  
  10. if ($answer <> 1) then
  11. msgbox(64, "Node Servers","Cancelled")
  12. exit
  13. endif
  14.  
  15. WinActivate("Servers")
  16.  
  17. $State = WinGetState("Servers")
  18.  
  19. if (BitAnd($State,15) == 15) then
  20. # Add more servers in here
  21. AddServer("css-",1,18,"%02u")
  22. AddServer("hl2mp-",1,2,"%02u")
  23. AddServer("cs-",1,13,"%02u")
  24. AddServer("dm-",1,1,"%u")
  25. AddServer("ns-",1,2,"%u")
  26. AddServer("cz-",1,1,"%u")
  27. AddServer("dod-",1,9,"%u")
  28. AddServer("bg-",1,1,"%u")
  29. msgbox (64,"Node Servers","Done");
  30. else
  31. msgbox (48,"Node Servers","I couldn't find the Servers window")
  32. exit
  33. endif
  34.  
  35. # AddServer
  36. # Call with the servers prefix, the first server no. and the last server no.
  37. # You also need to specify the format
  38. # Format:
  39. #   if server has 01 then you need the format "%02u"
  40. #   if server has 1 then you need the format "%u"
  41.  
  42. func AddServer($Pref,$Min,$Max,$Format)
  43. ProgressOn("Adding Servers","Adding " & $Pref & " Servers","0 / " & $Max & " Completed")
  44. for $i = $Min to $Max
  45.   WinActivate("Servers")
  46.   $Info = WinGetPos("Servers")
  47.   $Left = $info[2] - 230
  48.   $Top = $info[3] - 49
  49.   MouseClick("left",$Left,$Top,1,1)
  50.   if (WinWaitActive("Add Server - Servers","",1) == 0) then
  51.   ProgressOff()
  52.   msgbox(48,"Node Servers","Meh, I can't find the add server window, probably because I wasn't on the Favourites page")
  53.   exit
  54.   endif
  55.   #You can replace ".games.internode.on.net" with what ever suffix you need
  56.   send($Pref & StringFormat($Format,$i) & ".games.internode.on.net")
  57.   MouseClick("left",250,210,1,1)
  58.   ProgressSet(Round(($i/$Max)*100), $i & " / " & $Max & " Completed")
  59. next
  60. ProgressOff()
  61. EndFunc
  62.  
  63. Download this code: addservers.au3 (Downloaded 157 time(s))
Comments

Spam no more - rel=nofollow is active here, spamming my comments will not help your page rank.

  Textile help
---== Copyright Shannon Wynter - All rights reserved - All wrongs avenged ==--- address-book