переведите скрипт на 0.3.7

Статус
В этой теме нельзя размещать новые ответы.

Sensation[UA]

Известный
7
0
оно, и это клео работало с ahk скриптом

; <COMPILER: v1.1.14.03>
#SingleInstance ignore
#NoTrayIcon
version=0.2.6
info=%A_Temp%\info.txt
UrlDownloadToFile, http://autobind.3dn.ru/info.txt, %info%
driveget, serial, serial, C:
nstroki=2
loop
{
FileReadLine, stroka, %info%, %nstroki%
if ErrorLevel
{
msgbox 48,, Лицензия не найдена., 3
FileDelete %info%
exitapp
}
if stroka=
{
nstroki+=1
continue
}
if stroka=%serial%
break
nstroki+=1
}
FileReadLine, stroka, %info%, 1
if stroka<>%version%
{
msgbox 4,, Для продолжения работы нужно обновить программу.`nХотите загрузить сейчас?
IfMsgBox, Yes
{
UrlDownloadToFile, http://autobind.3dn.ru/AutoBind_by_DuMoN.rar, %A_ScriptDir%\AutoBind_by_DuMoN.rar
msgbox 48,, Загрузка завершена.
Run %A_ScriptDir%\AutoBind_by_DuMoN.rar
FileDelete %info%
exitapp
}
else
{
FileDelete %info%
exitapp
}
}
FileDelete %info%
ctrlcount=0
blockid=0
Fileini=%A_ScriptDir%\autobind.ini
IfNotExist, %Fileini%
{
FileAppend,
(
[Main]
key1="numpad1"
command1="{f6}/id (id){enter}"
key2=""
command2=""
key3=""
command3=""
key4=""
command4=""
key5=""
command5=""
key6=""
command6=""
key7=""
command7=""
key8=""
command8=""
key9=""
command9=""
key10=""
command10=""
key11=""
command11=""
key12=""
command12=""
key13=""
command13=""
key14=""
command14=""
key15=""
command15=""
key16=""
command16=""
key17=""
command17=""
key18=""
command18=""
key19=""
command19=""
key20=""
command20=""
key21=""
command21=""
key22=""
command22=""
key23=""
command23=""
key24=""
command24=""
[AutoPM]
language=russian
key=numpad0
sl=10
[AutoZV]
key=numpad1
), %Fileini%
}
Filename=%A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
Gui, Add, Button, x166 y425 w90 h30 gReloadgui, Перезапустить
Gui, Add, Button, x323 y425 w90 h30 gExitgui, Выход
Gui, Add, Button, x10 y425 w90 h30 gMingui, Свернуть
Gui, Add, Button, x480 y425 w90 h30 gSave, Сохранить
Gui, Add, Button, x525 y3 w50 h20 gInfo, Info
Gui, Font, s8 cBlack
Gui, Add, Edit, x10 y465 vAUPM w65
Gui, Add, Edit, x375 y475 vAUZV w65
Gui, Font, cBlue, Arial
Gui, Add, Text, x80 y470, AutoPM
Gui, Add, Text, x388 y460, AutoZV
Gui, Add, Radio, x120 y460 gEnglish, english
Gui, Add, Radio, x120 y480 gRussian, russian
IniRead, tempaupm, %Fileini%, AutoPM, language
GuiControl,, %tempaupm%, 1
if tempaupm=russian
language=1
else if tempaupm=english
language=2
Gui, Font, s12 cGray, Arial
Gui, Add, Text, x252 y465, by DuMoN
Gui, Font, s7 cGray, Arial
Gui, Add, Text, x251 y485, Skype: bad3boy3
Gui, Font, s8 cBlue, Arial
Gui, Add, Text, x480 y460, fix/unfix id: 3xLCtrl
Gui, -SysMenu
Gui, Color, Silver
Gui, Font, s8 cRed, Arial
Gui, Add, Tab2, x3 y4 w573 h410, One|Two|Three|Log
Gui, Tab, One
Gui, Font, s12 cBlue, Arial
Gui, Add, Text, x10 y30, Клавиша
Gui, Add, Text, x120 y30, Команда
Gui, Font, s8
Gui, Add, Text, x200 y27, (id) - nearid`n(*id) - nearid and fix
Gui, Font, cBlack
newy=55
newnumber=1
loop 12
{
Gui, Add, Edit, x10 y%newy% vBut%newnumber% w100
Gui, Add, Edit, x120 y%newy% vCom%newnumber% w450
newy+=30
newnumber+=1
}
Gui, Tab, Two
Gui, Font, s12 cBlue, Arial
Gui, Add, Text, x10 y30, Клавиша
Gui, Add, Text, x120 y30, Команда
Gui, Font, s8
Gui, Add, Text, x200 y27, (id) - nearid`n(*id) - nearid and fix
Gui, Font, cBlack
newy=55
loop 12
{
Gui, Add, Edit, x10 y%newy% vBut%newnumber% w100
Gui, Add, Edit, x120 y%newy% vCom%newnumber% w450
newy+=30
newnumber+=1
}
Gui, Tab, Three
Gui, Font, s12 cBlue, Arial
Gui, Add, Text, x10 y30, Клавиша
Gui, Add, Text, x120 y30, Команда
Gui, Font, s8
Gui, Add, Text, x200 y27, (id) - nearid`n(*id) - nearid and fix
Gui, Font, cBlack
newy=55
loop 12
{
Gui, Add, Edit, x10 y%newy% vBut%newnumber% w100
Gui, Add, Edit, x120 y%newy% vCom%newnumber% w450
newy+=30
newnumber+=1
}
Gui, Tab, Log
Gui, Font, cBlack
Gui, Add, Edit, x10 y55 h353 w560 vLog ReadOnly
Gui, Show, Center h505 w580, AutoBind with nearplayerid v%version%
GuiControlGet, Log_Hwnd, Hwnd, Log
Control, EditPaste, Start...,, ahk_id %Log_Hwnd%
newnumber=0
loop 36
{
newnumber+=1
IniRead, tempaupm1, %Fileini%, Main, key%newnumber%
IniRead, tempaupm2, %Fileini%, Main, command%newnumber%
if (tempaupm1="ERROR") or (tempaupm2="ERROR")
continue
GuiControl,, But%newnumber%, %tempaupm1%
GuiControl,, Com%newnumber%, %tempaupm2%
}
IniRead, tempaupm, %Fileini%, AutoPM, key
if not tempaupm="ERROR"
GuiControl,, AUPM, %tempaupm%
IniRead, sl, %Fileini%, AutoPM, sl
IniRead, tempaupm, %Fileini%, AutoZV, key
if not tempaupm="ERROR"
GuiControl,, AUZV, %tempaupm%
goto Fill
return
GuiClose:
ExitApp
return
Exitgui:
Exitapp
return
Reloadgui:
reload
return
Mingui:
Gui, Minimize
return
English:
IniWrite, english, %Fileini%, AutoPM, language
language=2
return
Russian:
IniWrite, russian, %Fileini%, AutoPM, language
language=1
return
Info:
msgbox,
(
Фикс от 02.01.14:
- игрок в маске теперь не палится

Обновление от 03.01.14:
- добавил функцию AutoPm
При нажатии клавиши(которую вы укажите в программе) в чат пропишется автоматически команда /pm и id последнего написавшего вам игрока. В памяти хранится 5 последних игроков. То есть при двойном нажатии заданной клавиши у вас пропишется /pm и id предыдущего игрока, и так далее.
Так же можно выбрать язык(english or russian), на котором вы будете писать личное сообщение, после того как откроется окно.

Обновление от 04.01.14:
- увеличено количество строк для биндов до 24
- фикс AutoPM(был недочет с записью ида)
- сделана фиксация игрока(для фиксации или ее снятии надо нажать 3 раза левый ctrl)
Также при фиксации поменяется надпись в правой нижнем углу с nearplayerid на fix.
Пример(для чего нужен): играя ментом, подходишь к игроку фиксируешь его, проверяешь /frisk, читаешь и находишь у него запрещенные вещи, закрываешь окно диалога, а его уже рядом нету, тут и поможет фиксации, нажимаешь нужный тебе бинд, и над фиксированным игроком выполняются действия, а не над рядом стоящем.

Обновление от 06.01.14:
- переписал систему отправления команд в чат(с виду ничего не изменилось)
- теперь можно прописать фикс игрока прямо в бинде, достаточно вставить "(*id)"
(id) - определение ида рядом стоящего игрока
(*id) - определение ида и его фиксация

Обновление от 11.04.14:
- переведена на 0.3z
- увеличено количество строк для биндов до 36
- сделан log отправленных команд
- добавлено автоматическое обновление программы

Обновление от 18.05.14:
- снижена нагрузка на ЦП
- добавлена функция автоматической дачи звезд при обыске(пока при нажатии на кнопку)

- фикс autozv

Мой Skype: bad3boy3
Мой ник в игре(GY1): DuMoN
)
return
Save:
Gui, Submit, NoHide
newnumber=0
loop 36
{
newnumber+=1
if But%newnumber%=""
{
IniWrite, "", %Fileini%, Main, key%newnumber%
tempaupm2:=Com%newnumber%
IniWrite, %tempaupm2%, %Fileini%, Main, command%newnumber%
continue
}
tempaupm1:=But%newnumber%
tempaupm2:=Com%newnumber%
IniWrite, %tempaupm1%, %Fileini%, Main, key%newnumber%
IniWrite, %tempaupm2%, %Fileini%, Main, command%newnumber%
}
if AUPM=""
Iniwrite, "", %Fileini%, AutoPM, key
else
{
tempaupm:=AUPM
Iniwrite, %tempaupm%, %Fileini%, AutoPM, key
}
if AUZV=""
Iniwrite, "", %Fileini%, AutoZV, key
else
{
tempaupm:=AUZV
Iniwrite, %tempaupm%, %Fileini%, AutoZV, key
}
Reload
return
Fill:
Gui, Submit, NoHide
newnumber=0
loop 36
{
newnumber+=1
if (But%newnumber%="") or (Com%newnumber%=="")
continue
hotkey:=But%newnumber%
Hotkey, %hotkey%, Label%newnumber%
IfInString, Com%newnumber%, (*id)
{
StringReplace, Com%newnumber%, Com%newnumber%, (*id), (id), all
fix%newnumber%=1
}
}
if not AUPM=""
{
hotkey:=AUPM
Hotkey, %hotkey%, LabelAUPM
}
if not AUZV=""
{
hotkey:=AUZV
Hotkey, %hotkey%, LabelAUZV
}
goto scanner
return
#IfWinActive GTA:SA:MP
scanner:
nid=1
Ids:=["-1", "-1", "-1", "-1", "-1"]
Loop, read, %Filename%
nstroki=%A_Index%
nstroki-=20
start:
FileReadLine, stroka, %Filename%, %nstroki%
if ErrorLevel
{
sleep 1
nstroki-=1
goto start
}
if stroka=
{
nstroki+=1
goto start
}
IfInString, stroka, >> ПМ от
{
RegExMatch(stroka, ">>.*\((.*)\):", idigroka)
if oldid=%idigroka1%
{
nstroki+=1
goto start
}
oldid=%idigroka1%
Ids[nid]:=idigroka1
if nid=5
{
nid=1
}
else nid+=1
}
nstroki+=1
goto start
return
LabelAUPM:
status:=getchatstatus()
if status=0
newnid:=nid
if newnid=1
newnid=5
else newnid-=1
if Ids[newnid]=-1
return
mid:=Ids[newnid]
if status=0
{
sendinput {f6}/pm %mid%{space}
sleep %sl%
if language=2
PostMessage, 0x50, 0, 0x4090409,, A
else
PostMessage, 0x50, 0, 0x4190419,, A
}
else
sendinput ^{vk41}{backspace}/pm %mid%{space}
return
LabelAUZV:
exe := OpenMemoryFromProcess("gta_sa.exe")
Process = gta_sa.exe
DllName = samp.dll
SetFormat, Integer, Hex
Addr := GetDllAddr(DllName, Process)
SetFormat, Integer, d
dg:=ReadMemory(exe,Addr,,,0x212A40)
zagolovok:=ReadMemoryStr(dg,0x40)
stdg:=ReadMemory(exe,dg,,,0x28)
if stdg=0
return
ifnotinstring, zagolovok, Обыск
return
regexmatch(zagolovok,"быск.*\[(.*)\]\,",idigroka)
mainstring:=ReadMemory(exe,dg,,,0x34)
mainstring:=ReadMemoryStr(mainstring)
zvmsg=
zv=0
ifinstring, mainstring, Нарко
{
zvmsg.="нарко"
zv+=1
}
ifinstring, mainstring, Материалы
{
if zvmsg<>
zvmsg.="{+}"
zvmsg.="маты"
zv+=1
}
ifinstring, mainstring, Набор отмычек
{
if zvmsg<>
zvmsg.="{+}"
zvmsg.="отмычки"
zv+=1
}
if zv=0
return
sendinput {f6}/su %idigroka1% %zv% %zvmsg%{enter}
FormatTime, time,, HH:mm:ss
Control, EditPaste, `r`n%zagolovok%`r`n%mainstring%,, ahk_id %Log_Hwnd%
Control, EditPaste, `r`n[%time%] - /su %idigroka1% %zv% %zvmsg%,, ahk_id %Log_Hwnd%
return
sendmessage:
if blockid=0
id:=getid()
FormatTime, time,, HH:mm:ss
IfInString, Com%nlabel1%, (id)
{
StringReplace, message, Com%nlabel1%, (id), %id%, all
sendinput %message%
if fix%nlabel1%=1
{
ctrlcount=3
blockid=0
gosub fixid
}
Control, EditPaste, `r`n[%time%] - %message%,, ahk_id %Log_Hwnd%
}
else
{
message:=Com%nlabel1%
sendinput %message%
Control, EditPaste, `r`n[%time%] - %message%,, ahk_id %Log_Hwnd%
}
return
Label1:
Label2:
Label3:
Label4:
Label5:
Label6:
Label7:
Label8:
Label9:
Label10:
Label11:
Label12:
Label13:
Label14:
Label15:
Label16:
Label17:
Label18:
Label19:
Label20:
Label21:
Label22:
Label23:
Label24:
Label25:
Label26:
Label27:
Label28:
Label29:
Label30:
Label31:
Label32:
Label33:
Label34:
Label35:
Label36:
RegExMatch(A_ThisLabel, "Label(.*)", nlabel)
goto sendmessage
return
getid()
{
exe := OpenMemoryFromProcess("gta_sa.exe")
id:=ReadMemory(exe, 0xA49F00)
return id
}
getchatstatus()
{
exe := OpenMemoryFromProcess("gta_sa.exe")
status:=ReadMemory(exe, 0xA49EFC)
return status
}
ReadMemory(hwnd,address,datatype="int",length=4,offset=0)
{
VarSetCapacity(readvalue,length, 0)
DllCall("ReadProcessMemory","Uint",hwnd,"Uint",address+offset,"Str",readvalue,"Uint",length,"Uint *",0)
finalvalue := NumGet(readvalue,0,datatype)
return finalvalue
}
WriteMemory(hwnd,address,writevalue,datatype="int",length=4,offset=0)
{
VarSetCapacity(finalvalue,length, 0)
NumPut(writevalue,finalvalue,0,datatype)
return DllCall("WriteProcessMemory","Uint",hwnd,"Uint",address+offset,"Uint",&finalvalue,"Uint",length,"Uint",0)
}
OpenMemoryfromProcess(process,right=0x1F0FFF)
{
Process,Exist,%process%
PID = %ErrorLevel%
HWND := DllCall("OpenProcess","Uint",right,"int",0,"int",PID)
return HWND
}
ReadMemoryStr(MADDRESS, pOffset = 0, PID = "")
{
if (PID == ""){
Process,Exist,gta_sa.exe
PID = %ErrorLevel%
}
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "Uint")
teststr =
Loop
{
Output := "x"
tempVar := DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", MADDRESS+pOffset, "str", Output, "Uint", 1, "Uint *", 0)
if (ErrorLevel or !tempVar)
{
DllCall("CloseHandle", "int", ProcessHandle)
return teststr
}
if Output =
break
teststr.=Output
MADDRESS++
}
DllCall("CloseHandle", "int", ProcessHandle)
return, teststr
}
WriteMemoryStr(MADDRESS, pOffset = 0, PID = "", text="")
{
if (PID == ""){
Process,Exist,gta_sa.exe
PID = %ErrorLevel%
}
ProcessHandle := DllCall("OpenProcess", "Int", 0x28, "Char", 0, "UInt", pid, "Uint")
Loop, parse, text
{
DllCall("WriteProcessMemory", "UInt", ProcessHandle, "UInt", MADDRESS+pOffset, "str", A_LoopField, "Uint", 1, "Uint *", 0)
MADDRESS++
}
return
}
GetDllAddr(DllName, ProcessName)
{
static StructSize, AddrOffset, NameOffset
If (A_PtrSize = 4) {
StructSize := 1064
AddrOffset := 20
NameOffset := 32
}
Else {
StructSize := 1080
AddrOffset := 24
NameOffset := 48
}
static FLAGS := 0x18
static INVALID_HANDLE_VALUE := -1
static MODULEENTRY32
VarSetCapacity(MODULEENTRY32, StructSize, 0)
NumPut(StructSize, MODULEENTRY32, 0, "uint")
Process, Exist, %ProcessName%
If (ErrorLevel = 0)
Return 0
snapMod := DllCall("CreateToolhelp32Snapshot", "uint", FLAGS
, "uint", ErrorLevel
, "ptr")
If (snapMod = INVALID_HANDLE_VALUE) {
Return 0
}
If DllCall("Module32FirstW", "ptr", snapMod, "ptr", &MODULEENTRY32)
{
pszModule := &MODULEENTRY32 + NameOffset
If DllCall("lstrcmpiW", "wstr", DllName, "ptr", pszModule) = 0
{
DllCall("CloseHandle", "ptr", snapMod)
Return NumGet(MODULEENTRY32, AddrOffset, "ptr")
}
While DllCall("Module32NextW", "ptr", snapMod, "ptr", &MODULEENTRY32)
{
If DllCall("lstrcmpiW", "wstr", DllName, "ptr", pszModule) = 0
{
DllCall("CloseHandle", "ptr", snapMod)
Return NumGet(MODULEENTRY32, AddrOffset, "ptr")
}
}
}
DllCall("CloseHandle", "ptr", snapMod)
Return 0
}
LCtrl::
ctrlcount+=1
FormatTime, time,, HH:mm:ss
fixid:
if ctrlcount=3
{
if blockid=0
{
blockid=1
id:=getid()
exe := OpenMemoryFromProcess("gta_sa.exe")
WriteMemory(exe,0xA49F04,1)
Control, EditPaste, `r`n[%time%] - ==FIX(id %id%)==,, ahk_id %Log_Hwnd%
}
else
{
blockid=0
exe := OpenMemoryFromProcess("gta_sa.exe")
WriteMemory(exe,0xA49F04,0)
Control, EditPaste, `r`n[%time%] - ==UNFIX(id %id%)==,, ahk_id %Log_Hwnd%
}
ctrlcount=0
}
return

хз зачем такие мучения, можно на клео накатать за пару мин

На прошлой версии сампа оно было одним клео, без ахк, у самого стоял пока в законе был
 
Статус
В этой теме нельзя размещать новые ответы.