Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; J's SAMP Keybinder with Automated Responses V1.12
- ; Jaycob.co.nf for more San Andreas Multiplayer scripts
- ; Updated on 03/04/2013
- #SingleInstance force
- ; check for chatlog
- INIRead, logfile, binds.ini, general, logfile
- If (logfile == "ERROR"){
- msgbox Hit Ok and find the SAMP chatlog (default location on WindowsXP is "My Documents\GTA San Andreas User Files\SAMP\chatlog.txt") You can ignor this by hitting cancel on the next window if you don't plan on using automated responses. It will ask again on next launch incase you change your mind.
- FileSelectFile, logfile,,,Selet GTA chat log, Documents (*.txt)
- If (logfile == ""){
- MsgBox, No file selected, automated responses wont work.
- } Else {
- INIWrite, %logfile%, binds.ini, general, logfile
- }
- }
- ; Main GUI
- main:
- IniRead, box1, %A_ScriptDir%\binds.ini, Binds, box1
- IniRead, box2, %A_ScriptDir%\binds.ini, Binds, box2
- IniRead, box3, %A_ScriptDir%\binds.ini, Binds, box3
- IniRead, box4, %A_ScriptDir%\binds.ini, Binds, box4
- IniRead, box5, %A_ScriptDir%\binds.ini, Binds, box5
- IniRead, box6, %A_ScriptDir%\binds.ini, Binds, box6
- IniRead, box7, %A_ScriptDir%\binds.ini, Binds, box7
- IniRead, box8, %A_ScriptDir%\binds.ini, Binds, box8
- IniRead, box9, %A_ScriptDir%\binds.ini, Binds, box9
- IniRead, box0, %A_ScriptDir%\binds.ini, Binds, box0
- IniRead, box11, %A_ScriptDir%\binds.ini, Binds, box11
- IniRead, box21, %A_ScriptDir%\binds.ini, Binds, box21
- IniRead, box31, %A_ScriptDir%\binds.ini, Binds, box31
- IniRead, box41, %A_ScriptDir%\binds.ini, Binds, box41
- IniRead, box51, %A_ScriptDir%\binds.ini, Binds, box51
- IniRead, box61, %A_ScriptDir%\binds.ini, Binds, box61
- IniRead, box71, %A_ScriptDir%\binds.ini, Binds, box71
- IniRead, box81, %A_ScriptDir%\binds.ini, Binds, box81
- IniRead, box91, %A_ScriptDir%\binds.ini, Binds, box91
- IniRead, box01, %A_ScriptDir%\binds.ini, Binds, box01
- IniRead, boxsub, %A_ScriptDir%\binds.ini, Binds, boxsub
- IniRead, boxadd, %A_ScriptDir%\binds.ini, Binds, boxadd
- IniRead, boxent, %A_ScriptDir%\binds.ini, Binds, boxent
- IniRead, boxdot, %A_ScriptDir%\binds.ini, Binds, boxdot
- IniRead, boxphr, %A_ScriptDir%\binds.ini, Binds, boxphr
- IniRead, boxres, %A_ScriptDir%\binds.ini, Binds, boxres
- Gui, Add, Text, x406 y20 w150 h510 , Examples:
- Gui, Add, Text, x414 y38 w120 h60 , /me has done that
- Gui, Add, Text, x414 y58 w110 h20 , /s WOOOO
- Gui, Add, Text, x416 y80 w80 h20 , Good'ay mate.
- Gui, Add, Text, x416 y100 w110 h20 , /enter
- Gui, Add, Text, x406 y120 w140 h50 , Avoid using ^`, !`, * certain punctuations might act as keys (like Enter or Ctrl)
- Gui, Add, Text, x406 y170 w150 h40 , To send more than one with one key add "{ENTER}t" between the lines
- Gui, Add, Text, x406 y220 w100 h20 , Examples:
- Gui, Add, Text, x416 y240 w110 h30 , /getmats{ENTER}t/me picks up some mats
- Gui, Add, Text, x416 y270 w120 h30 , /me opens the door and enters{ENTER}t/enter
- Gui, Add, Text, x416 y300 w140 h30 , /fucku{ENTER}tFUCKER
- Gui, Add, Text, x406 y320 w150 h70 , If it says "ERROR" it's because there's no save(binds.ini). They will go away when you replace them with anything`, hit ok and a save is created
- Gui, Add, Button, x406 y400 w140 h40 , AutoReply
- Gui, Add, Text, x406 y460 w140 h70 , F11 will bring you back to this window. NUMLOCK to toggle hotkeys. Right click the icon next to the time and hit exit to exit.
- Gui, Add, Button, x406 y540 w140 h70 , OK
- Gui, Add, Text, x6 y20 w130 h20 , *NUMPAD1*
- Gui, Add, Text, x6 y70 w130 h20 , *NUMPAD2*
- Gui, Add, Text, x6 y120 w130 h20 , *NUMPAD3*
- Gui, Add, Text, x6 y170 w130 h20 , *NUMPAD4*
- Gui, Add, Text, x6 y220 w130 h20 , *NUMPAD5*
- Gui, Add, Text, x6 y270 w130 h20 , *NUMPAD6*
- Gui, Add, Text, x6 y320 w130 h20 , *NUMPAD7*
- Gui, Add, Text, x6 y370 w130 h20 , *NUMPAD8*
- Gui, Add, Text, x6 y420 w130 h20 , *NUMPAD9*
- Gui, Add, Text, x6 y470 w130 h20 , *NUMPAD0*
- Gui, Add, Text, x6 y520 w130 h20 , *NUMPAD ENTER*
- Gui, Add, Text, x6 y570 w130 h20 , *NUMPAD DOT*
- Gui, Add, Text, x206 y20 w130 h20 , *ALT+NUMPAD1*
- Gui, Add, Text, x206 y70 w130 h20 , *ALT+NUMPAD2*
- Gui, Add, Text, x206 y120 w130 h20 , *ALT+NUMPAD3*
- Gui, Add, Text, x206 y170 w130 h20 , *ALT+NUMPAD4*
- Gui, Add, Text, x206 y220 w130 h20 , *ALT+NUMPAD5*
- Gui, Add, Text, x206 y270 w130 h20 , *ALT+NUMPAD6*
- Gui, Add, Text, x206 y320 w130 h20 , *ALT+NUMPAD7*
- Gui, Add, Text, x206 y370 w130 h20 , *ALT+NUMPAD8*
- Gui, Add, Text, x206 y420 w130 h20 , *ALT+NUMPAD9*
- Gui, Add, Text, x206 y470 w130 h20 , *ALT+NUMPAD0*
- Gui, Add, Text, x206 y520 w130 h20 , *NUMPAD ADD*
- Gui, Add, Text, x206 y570 w130 h20 , *NUMPAD SUB*
- Gui, Add, Edit, x6 y40 vbox1 w190 h20 , %box1%
- Gui, Add, Edit, x6 y90 vbox2 w190 h20 , %box2%
- Gui, Add, Edit, x6 y140 vbox3 w190 h20 , %box3%
- Gui, Add, Edit, x6 y190 vbox4 w190 h20 , %box4%
- Gui, Add, Edit, x6 y240 vbox5 w190 h20 , %box5%
- Gui, Add, Edit, x6 y290 vbox6 w190 h20 , %box6%
- Gui, Add, Edit, x6 y340 vbox7 w190 h20 , %box7%
- Gui, Add, Edit, x6 y390 vbox8 w190 h20 , %box8%
- Gui, Add, Edit, x6 y440 vbox9 w190 h20 , %box9%
- Gui, Add, Edit, x6 y490 vbox0 w190 h20 , %box0%
- Gui, Add, Edit, x6 y540 vboxent w190 h20 , %boxent%
- Gui, Add, Edit, x6 y590 vboxdot w190 h20 , %boxdot%
- Gui, Add, Edit, x206 y590 vboxsub w190 h20 , %boxsub%
- Gui, Add, Edit, x206 y540 vboxadd w190 h20 , %boxadd%
- Gui, Add, Edit, x206 y490 vbox01 w190 h20 , %box01%
- Gui, Add, Edit, x206 y440 vbox91 w190 h20 , %box91%
- Gui, Add, Edit, x206 y390 vbox81 w190 h20 , %box81%
- Gui, Add, Edit, x206 y340 vbox71 w190 h20 , %box71%
- Gui, Add, Edit, x206 y290 vbox61 w190 h20 , %box61%
- Gui, Add, Edit, x206 y240 vbox51 w190 h20 , %box51%
- Gui, Add, Edit, x206 y190 vbox41 w190 h20 , %box41%
- Gui, Add, Edit, x206 y140 vbox31 w190 h20 , %box31%
- Gui, Add, Edit, x206 y90 vbox21 w190 h20 , %box21%
- Gui, Add, Edit, x206 y40 vbox11 w190 h20 , %box11%
- Gui, Add, Text, x126 y0 w250 h20 +Center, @!@@.:J's SA-MP Keybinder v1.12:.@@!@
- Gui, Show, w558 h628, J's SA-MP Binder v1.12
- return
- ; Main GUI AutoReply button
- ButtonAutoReply:
- gui, submit
- IniWrite, %box1%, %A_ScriptDir%\binds.ini, Binds, box1
- IniWrite, %box2%, %A_ScriptDir%\binds.ini, Binds, box2
- IniWrite, %box3%, %A_ScriptDir%\binds.ini, Binds, box3
- IniWrite, %box4%, %A_ScriptDir%\binds.ini, Binds, box4
- IniWrite, %box5%, %A_ScriptDir%\binds.ini, Binds, box5
- IniWrite, %box6%, %A_ScriptDir%\binds.ini, Binds, box6
- IniWrite, %box7%, %A_ScriptDir%\binds.ini, Binds, box7
- IniWrite, %box8%, %A_ScriptDir%\binds.ini, Binds, box8
- IniWrite, %box9%, %A_ScriptDir%\binds.ini, Binds, box9
- IniWrite, %box0%, %A_ScriptDir%\binds.ini, Binds, box0
- IniWrite, %box11%, %A_ScriptDir%\binds.ini, Binds, box11
- IniWrite, %box21%, %A_ScriptDir%\binds.ini, Binds, box21
- IniWrite, %box31%, %A_ScriptDir%\binds.ini, Binds, box31
- IniWrite, %box41%, %A_ScriptDir%\binds.ini, Binds, box41
- IniWrite, %box51%, %A_ScriptDir%\binds.ini, Binds, box51
- IniWrite, %box61%, %A_ScriptDir%\binds.ini, Binds, box61
- IniWrite, %box71%, %A_ScriptDir%\binds.ini, Binds, box71
- IniWrite, %box81%, %A_ScriptDir%\binds.ini, Binds, box81
- IniWrite, %box91%, %A_ScriptDir%\binds.ini, Binds, box91
- IniWrite, %box01%, %A_ScriptDir%\binds.ini, Binds, box01
- IniWrite, %boxent%, %A_ScriptDir%\binds.ini, Binds, boxent
- IniWrite, %boxsub%, %A_ScriptDir%\binds.ini, Binds, boxsub
- IniWrite, %boxadd%, %A_ScriptDir%\binds.ini, Binds, boxadd
- IniWrite, %boxdot%, %A_ScriptDir%\binds.ini, Binds, boxdot
- Gui, Destroy
- ; Autoreply GUI
- INIRead, logfile, binds.ini, general, logfile
- If (logfile == "ERROR"){
- msgbox you must restart this program and select the SAMP chatlog to use this function
- goto main
- }
- else
- IniRead, boxphr1, %A_ScriptDir%\binds.ini, Binds, boxphr1
- IniRead, boxphr2, %A_ScriptDir%\binds.ini, Binds, boxphr2
- IniRead, boxphr3, %A_ScriptDir%\binds.ini, Binds, boxphr3
- IniRead, boxres1, %A_ScriptDir%\binds.ini, Binds, boxres1
- IniRead, boxres2, %A_ScriptDir%\binds.ini, Binds, boxres2
- IniRead, boxres3, %A_ScriptDir%\binds.ini, Binds, boxres3
- Gui, Add, Text, x6 y0 w320 h20 , Automated responses:
- Gui, Add, Text, x12 y20 w310 h30 , Automaticly sends the "Reply" box if they say what's written in the "if they say" box
- Gui, Add, Text, x6 y50 w280 h20 +Center, *Buggy* to disable write gibberish in the "if they say" box
- Gui, Add, Text, x166 y70 w160 h20 , Reply:
- Gui, Add, Edit, x166 y90 vboxphr1 w160 h20 , %boxphr1%
- Gui, Add, Edit, x166 y110 vboxphr2 w160 h20 , %boxphr2%
- Gui, Add, Edit, x166 y130 vboxphr3 w160 h20 , %boxphr3%
- Gui, Add, Text, x6 y70 w160 h20 , If they say:
- Gui, Add, Edit, x6 y90 vboxres1 w160 h20 , %boxres1%
- Gui, Add, Edit, x6 y110 vboxres2 w160 h20 , %boxres2%
- Gui, Add, Edit, x6 y130 vboxres3 w160 h20 , %boxres3%
- Gui, Add, Button, x6 y150 w320 h40 , Set
- Gui, Show, w336 h197, Js SAMP Automated Responses
- return
- ; Autoreply GUI Set button GUI
- ButtonSet:
- gui, submit
- IniWrite, %boxphr1%, %A_ScriptDir%\binds.ini, Binds, boxphr1
- IniWrite, %boxres1%, %A_ScriptDir%\binds.ini, Binds, boxres1
- IniWrite, %boxphr2%, %A_ScriptDir%\binds.ini, Binds, boxphr2
- IniWrite, %boxres2%, %A_ScriptDir%\binds.ini, Binds, boxres2
- IniWrite, %boxphr3%, %A_ScriptDir%\binds.ini, Binds, boxphr3
- IniWrite, %boxres3%, %A_ScriptDir%\binds.ini, Binds, boxres3
- gui, destroy
- goto, main
- return
- ; Main GUI Ok button
- ButtonOK:
- gui, submit
- IniWrite, %box1%, %A_ScriptDir%\binds.ini, Binds, box1
- IniWrite, %box2%, %A_ScriptDir%\binds.ini, Binds, box2
- IniWrite, %box3%, %A_ScriptDir%\binds.ini, Binds, box3
- IniWrite, %box4%, %A_ScriptDir%\binds.ini, Binds, box4
- IniWrite, %box5%, %A_ScriptDir%\binds.ini, Binds, box5
- IniWrite, %box6%, %A_ScriptDir%\binds.ini, Binds, box6
- IniWrite, %box7%, %A_ScriptDir%\binds.ini, Binds, box7
- IniWrite, %box8%, %A_ScriptDir%\binds.ini, Binds, box8
- IniWrite, %box9%, %A_ScriptDir%\binds.ini, Binds, box9
- IniWrite, %box0%, %A_ScriptDir%\binds.ini, Binds, box0
- IniWrite, %box11%, %A_ScriptDir%\binds.ini, Binds, box11
- IniWrite, %box21%, %A_ScriptDir%\binds.ini, Binds, box21
- IniWrite, %box31%, %A_ScriptDir%\binds.ini, Binds, box31
- IniWrite, %box41%, %A_ScriptDir%\binds.ini, Binds, box41
- IniWrite, %box51%, %A_ScriptDir%\binds.ini, Binds, box51
- IniWrite, %box61%, %A_ScriptDir%\binds.ini, Binds, box61
- IniWrite, %box71%, %A_ScriptDir%\binds.ini, Binds, box71
- IniWrite, %box81%, %A_ScriptDir%\binds.ini, Binds, box81
- IniWrite, %box91%, %A_ScriptDir%\binds.ini, Binds, box91
- IniWrite, %box01%, %A_ScriptDir%\binds.ini, Binds, box01
- IniWrite, %boxent%, %A_ScriptDir%\binds.ini, Binds, boxent
- IniWrite, %boxsub%, %A_ScriptDir%\binds.ini, Binds, boxsub
- IniWrite, %boxadd%, %A_ScriptDir%\binds.ini, Binds, boxadd
- IniWrite, %boxdot%, %A_ScriptDir%\binds.ini, Binds, boxdot
- sleep 100
- WinWait, GTA:SA:MP,
- IfWinNotActive, GTA:SA:MP, , WinActivate, GTA:SA:MP,
- WinWaitActive, GTA:SA:MP,
- sleep 100
- ; AutoReply Chatlog reader/sender
- last = 1
- line = 2
- phrase1 = %boxphr1%
- response1 = %boxres1%
- phrase2 = %boxphr2%
- response2 = %boxres2%
- phrase3 = %boxphr3%
- response3 = %boxres3%
- loop,{
- top:
- Loop, read, %logfile%
- {
- if A_LoopReadLine > 0
- {
- line = %A_LoopReadLine%
- }
- }
- go:
- if last = %line%
- {
- goto top
- }
- IfInString, line, %response1%
- {
- send t{CtrlDown}a{CtrlUp}{delete}%phrase1%{enter}
- sleep 5000
- goto top
- }
- else
- IfInString, line, %response2%
- {
- send t{CtrlDown}a{CtrlUp}{delete}%phrase2%{enter}
- sleep 5000
- goto top
- }
- else
- IfInString, line, %response3%
- {
- send t{CtrlDown}a{CtrlUp}{delete}%phrase3%{enter}
- sleep 5000
- goto top
- }
- else
- sleep 1000
- goto top
- }
- return
- ; Main Gui hotkey
- F11::
- Gui, destroy
- goto, main
- return
- ; Bind Hotkeys
- Numpad0::
- send, t{CtrlDown}a{CtrlUp}{delete}%box0%{enter}
- return
- !Numpad0::
- send, t{CtrlDown}a{CtrlUp}{delete}%box01%{enter}
- return
- Numpad1::
- send, t{CtrlDown}a{CtrlUp}{delete}%box1%{enter}
- return
- !Numpad1::
- send, t{CtrlDown}a{CtrlUp}{delete}%box11%{enter}
- return
- Numpad2::
- send, t{CtrlDown}a{CtrlUp}{delete}%box2%{enter}
- return
- !Numpad2::
- send, t{CtrlDown}a{CtrlUp}{delete}%box21%{enter}
- return
- Numpad3::
- send, t{CtrlDown}a{CtrlUp}{delete}%box3%{enter}
- return
- !Numpad3::
- send, t{CtrlDown}a{CtrlUp}{delete}%box31%{enter}
- return
- Numpad4::
- send, t{CtrlDown}a{CtrlUp}{delete}%box4%{enter}
- return
- !Numpad4::
- send, t{CtrlDown}a{CtrlUp}{delete}%box41%{enter}
- return
- Numpad5::
- send, t{CtrlDown}a{CtrlUp}{delete}%box5%{enter}
- return
- !Numpad5::
- send, t{CtrlDown}a{CtrlUp}{delete}%box51%{enter}
- return
- Numpad6::
- send, t{CtrlDown}a{CtrlUp}{delete}%box6%{enter}
- return
- !Numpad6::
- send, t{CtrlDown}a{CtrlUp}{delete}%box61%{enter}
- return
- Numpad7::
- send, t{CtrlDown}a{CtrlUp}{delete}%box7%{enter}
- return
- !Numpad7::
- send, t{CtrlDown}a{CtrlUp}{delete}%box71%{enter}
- return
- Numpad8::
- send, t{CtrlDown}a{CtrlUp}{delete}%box8%{enter}
- return
- !Numpad8::
- send, t{CtrlDown}a{CtrlUp}{delete}%box81%{enter}
- return
- Numpad9::
- send, t{CtrlDown}a{CtrlUp}{delete}%box9%{enter}
- return
- !Numpad9::
- send, t{CtrlDown}a{CtrlUp}{delete}%box91%{enter}
- return
- Numpadsub::
- send, t{CtrlDown}a{CtrlUp}{delete}%boxsub%{enter}
- return
- Numpadadd::
- send, t{CtrlDown}a{CtrlUp}{delete}%boxadd%{enter}
- return
- Numpaddot::
- send, t{CtrlDown}a{CtrlUp}{delete}%boxdot%{enter}
- return
- NumpadEnter::
- send, t{CtrlDown}a{CtrlUp}{delete}%boxent%{enter}
- return
- ; ALT+F11 to reload script(added for testing purposes)
- !f11::reload
- ; fin
Advertisement
Add Comment
Please, Sign In to add comment