1 (изменено: vchih277, 2018-07-19 17:36:27)

Тема: АХК для SA:MP

Здравствуйте. Нужна помощь, нужно сделать так, чтоб этот АХК работал когда игра свернута. В AHK не особо шарю, поэтому не ругайтесь

StringCaseSense, Locale
name = C:\Users\Fanta\Documents\GTA San Andreas User Files\SAMP\chatlog.txt
loop
{
lastline := GetNewLine(name)
IfInString, lastline, Connected to {B9C9BF}Diamond Role Play | Sapphire
{
sleep 5000
SendInput, password{enter}
}
ifinstring, lastline, Server closed the connection.
{
sleep 1500
SendInput, {f6}/rec 20{enter}
}
}
GetNewLine(filename)
{
   static old
   static new
   if !old
   {
      FileGetSize, old, %filename%
      new := old
   }
   while old = new
   {
      sleep 500
      FileGetSize, new, %filename%
   }
   old := new
   Loop, read, %filename%
      if A_LoopReadLine
         last := A_LoopReadLine
   return last
}

2 (изменено: vchih277, 2018-07-20 18:37:43)

Re: АХК для SA:MP

stealzy
Пробовал вчера еще так, перестало работать вовсе даже при открытой игре.

StringCaseSense, Locale
name = C:\Users\Fanta\Documents\GTA San Andreas User Files\SAMP\chatlog.txt
loop
{
lastline := GetNewLine(name)
IfInString, lastline, Connected to {B9C9BF}Diamond Role Play | Sapphire
{
sleep 5000
ControlSend, password{enter}, ahk_exe gta_sa.exe
}
ifinstring, lastline, Server closed the connection.
{
sleep 1500
ControlSend, {f6}/rec 20{enter}, ahk_exe gta_sa.exe
}
}
GetNewLine(filename)
{
   static old
   static new
   if !old
   {
      FileGetSize, old, %filename%
      new := old
   }
   while old = new
   {
      sleep 500
      FileGetSize, new, %filename%
   }
   old := new
   Loop, read, %filename%
      if A_LoopReadLine
         last := A_LoopReadLine
   return last
}

3

Re: АХК для SA:MP

Попробуй взять что-нибудь из этой темы.

4

Re: АХК для SA:MP

Kinobi 0 in skripti
Да вчера по этой и еще нескольким похожими сидел больше часа и результат никакой, видимо не мое это) Но спасибо за подсказку

5 (изменено: vchih277, 2018-07-20 22:26:11)

Re: АХК для SA:MP

stealzy
Т.е. эта строка будет выглядеть так?:

ControlSend, , password{enter}, ahk_exe gta_sa.exe

Ну и другая строка с ControlSent по такому же принцыпу

6

Re: АХК для SA:MP

stealzy
Никакого результата, но спасибо за попытку помочь