You are Here:
POINTS on long goal servers.

Author (Read 8276 times)

POINTS on long goal servers.
« on: March 01, 2021, 04:58:19 pm »
 

constructor

  • Newbie
  • *
  • 11
    Posts
  • Karma: 0
    • View Profile
Greetings,

I am so annoyed, raging and fuming. And reason is the same why I stop playing sometimes. I can play 2-3 hours sometimes per day. Leaving my laptop on. When I am back, my company won, but I am disconnected - no points (usual). I stop playing again for another 3 month break I think.

Suggestion: If company reaches 100million pounds per year - points are delivered automatically on hard servers (5 and 8). As long as there is only 1 company on one of the long servers.

Cheers,
CONSTRUCTOR.
 

Re: POINTS on long goal servers.
« Reply #1 on: March 01, 2021, 05:41:59 pm »
 

constructor

  • Newbie
  • *
  • 11
    Posts
  • Karma: 0
    • View Profile
I wrote simple script.
Download n-ice.org/openttd latest client.
Then make 3 images of screen (full or windowed mode)
1. Your server button.
2. Any image of ingame (i used save button)
3. login button.

Script will every 10 seconds try to find error and relogin.

#IfWinActive, ahk_class OTTD
^P::Pause
^S::


Server:
Loop,
{
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\Users\vlad\Desktop\autoc\serv8.png
if (ErrorLevel = 2)
   {
    ToolTip, Could not conduct the search of server8.,100,100
   Sleep, 1000
   }
else if (ErrorLevel = 1)
   {
    ToolTip, server8 could not be found on the screen.,100,100
   Sleep, 10000
   }
else
   {
    ToolTip, server8 was found at %FoundX%x%FoundY%.,100,100
   x:=FoundX+50
   y:=FoundY+5
   Click, %x%, %y%
   Sleep, 3000
   Goto, InGame
   }
}


InGame:
Loop,
{
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\Users\vlad\Desktop\autoc\save.png
if (ErrorLevel = 2)
   {
    ToolTip, Could not conduct the search of save button.,100,100
   Sleep, 1000
   }
else if (ErrorLevel = 1)
   {
    ToolTip, save button could not be found on the screen.,100,100
   Sleep, 200
   }
else
   {
    ToolTip, save button was found at %FoundX%x%FoundY%.,100,100
   MouseMove, %FoundX%, %FoundY%
   Sleep, 500
   Goto, Login
   }
}


Login:
Loop,
{
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\Users\vlad\Desktop\autoc\login.png
if (ErrorLevel = 2)
   {
    ToolTip, Could not conduct the search of Login.,100,100
   Sleep, 1000
   }
else if (ErrorLevel = 1)
   {
    ToolTip, Login could not be found on the screen.,100,100
   Sleep, 200
   Send {N}
   Sleep, 200
   }
else
   {
    ToolTip, Login was found at %FoundX%x%FoundY%.,100,100
   x:=FoundX+50
   y:=FoundY+5
   Click, %x%, %y%
   Sleep, 3000
   Goto, Server
   }
}

Thanks,
Constructor
 

Re: POINTS on long goal servers.
« Reply #2 on: March 02, 2021, 05:03:50 am »
 

Doc

  • Newbie
  • *
  • 20
    Posts
  • Karma: 0
    • View Profile
I know what you mean. Happend to me two or three times in a row recently.... so I have switched to short goals for a while, or at least until I can ensure I will be active at endgame.

What platform does that script run on? Is it VB or powershell, or something else?

Cheers,
Doc
 

Re: POINTS on long goal servers.
« Reply #3 on: March 02, 2021, 11:24:03 am »
 

constructor

  • Newbie
  • *
  • 11
    Posts
  • Karma: 0
    • View Profile
Hello Doc,

Script is written in autohotkey which is based on C. Type autohotkey in google, download, install. Then copy text to .txt file and save it as anynamehere.ahk. To run the script press Ctrl+S. To stop press Ctrl+P. Don't forget to make pictures and run it on the main window. It will auto-connect to server 8 and auto-login. If you want, I can show in detail with pictures.

PS: I just had enough haha :D

Cheers,
Constructor
 

Re: POINTS on long goal servers.
« Reply #4 on: March 14, 2021, 12:56:52 pm »
 

constructor

  • Newbie
  • *
  • 11
    Posts
  • Karma: 0
    • View Profile
;Code update and picture attached. Check.
;download autohotkey, install.
;copy code below to .txt file and save it to autologin.ahk.
;To start the script press CTRL+S, to pause CTRL+P



;OPENTTD AUTOLOGIN by constructor ver 1.2
#IfWinActive, ahk_class OTTD
^P::Pause
^S::

;take screen of your openttd n-ice client and make 3 cropped pictures (press Fn+TakeScreen buttons or can use snipping tool if windowed)
;some clicking coordinates might need to be changed due to screen resolution.

tx:=1250      ;message x coord
ty:=0      ;message y coord
c:=0         ;counter

add_1:="C:\Users\vlad\Desktop\autoc\serv5.png"      ;change to address where you hold n-ice client server 5 button
add_2:="C:\Users\vlad\Desktop\autoc\save.png"      ;change to address where you hold ingame cropped save button
add_3:="C:\Users\vlad\Desktop\autoc\login.png"      ;in game press "N" then crop the login button and put address here

Server:
Loop,
{
imgname:="serv5.png"
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %add_1%
if (ErrorLevel = 2)
   {
      ToolTip, invalid search -> %imgname% counter=%c% ,%tx%,%ty%
   c++
   Sleep, 1000
   }
else if (ErrorLevel = 1)
   {
       ToolTip, no found -> %imgname% counter=%c% ,%tx%,%ty%
   c++
   Sleep, 5000
   }
else
   {
       ToolTip, %imgname% was found at %FoundX%x%FoundY% counter=%c% ,%tx%,%ty%
   x:=FoundX+50
   y:=FoundY+5
   Sleep, 500
   c=0
   Sleep, 500
   Click, %x%, %y%
   Sleep, 3000
   Goto, InGame
   }
}


InGame:
Loop,
{
imgname:="save.png"
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %add_2%
if (ErrorLevel = 2)
   {
   if(c>10)
      {
          Goto, server
      }
   else
      {
      ToolTip, invalid search -> %imgname% counter=%c% ,%tx%,%ty%
      c++
      Sleep, 1000
      }
   }
else if (ErrorLevel = 1)
   {
   if(c>10)
      {
          Goto, server
      }
   else
      {
      ToolTip, searching... -> %imgname% counter=%c% ,%tx%,%ty%
      c++
      Sleep, 1000
      }
   }
else
   {
       ToolTip, %imgname% was found at %FoundX%x%FoundY% counter=%c% ,%tx%,%ty%
   ;MouseMove, %FoundX%, %FoundY%
   Sleep, 500
   c=0
   Sleep, 500
   Goto, Login
   }
}


Login:
Loop,
{
imgname:="login.png"
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %add_3%
if (ErrorLevel = 2)
   {
   if(c>10)
      {
          Goto, server
      }
   else
      {
      ToolTip, invalid search -> %imgname% counter=%c% ,%tx%,%ty%
      c++
      Sleep, 1000
      }
   }
else if (ErrorLevel = 1)
   {
   if(c>10)
      {
          Goto, server
      }
   else
      {
      ToolTip, searching... -> %imgname% counter=%c% ,%tx%,%ty%
      Sleep, 500
      c++
      Sleep, 500
      Send {N}
      }
   }
else
   {
       ToolTip, Login was found at %FoundX%x%FoundY% counter=%c% ,%tx%,%ty%
   x:=FoundX+50
   y:=FoundY+5
   Click, %x%, %y%
   Sleep, 3000
   c=0
   Goto, Server
   }
}
 

Re: POINTS on long goal servers.
« Reply #5 on: March 14, 2021, 01:04:42 pm »
 

constructor

  • Newbie
  • *
  • 11
    Posts
  • Karma: 0
    • View Profile
cropping instructions:

check pics.