Mumms Posted April 26, 2011 Posted April 26, 2011 So my program is an "Admin Bot" for Soldier of Fortune 2. When Players "report" another player while in game, It logs thier Id, and the reason they were reported. When a player has been reported 3 times, I want it to send an admin running the program a message saying that they are needed in the server, but have no clue how to do that. My guess would be to use TCP but have to clue how to make it work, any help expandcollapse popupFunc reportAdd() $kill = IniRead("demo/MP/AdminBot/Reports.ini", "ID: " & $userName, $reason,0) $kills = ($kill + 1) $totalReport = IniRead("demo/MP/AdminBot/Reports.ini", "ID: " & $userName, "Total Reports ",0) $totalReports = ($totalReport + 1) IniWrite("demo/MP/AdminBot/Reports.ini", "ID: " & $userName, $reason, $kills) IniWrite("demo/MP/AdminBot/Reports.ini", "ID: " & $userName, "Total Reports ", $totalReports) If $totalReports = 3 Then _KickReportWarn() Elseif $totalReports = 5 Then _KickReport() Else printReport() EndIf EndFunc Func printReport() $s_FileName = _TempFile("demo/MP/", "vPlaybind", ".cfg") FileWrite("demo/MP/vPlaybind.cfg",'rcon "') FileWrite("demo/MP/vPlaybind.cfg","^3[^3AdminBot^3]^7: ID: ^3" & $userName & " ^7has been reported for: ^3" & $reason) FileWrite("demo/MP/vPlaybind.cfg",'"') Sleep(1755) Send("{Home}") FileDelete("demo/MP/vPlaybind.cfg") EndFunc Func _KickReportWarn() $s_FileName = _TempFile("demo/MP/", "vPlaybind", ".cfg") FileWrite("demo/MP/vPlaybind.cfg",'rcon "') FileWrite("demo/MP/vPlaybind.cfg","^3[^3AdminBot^3]^7: ID: ^3" & $userName & " ^7has been reported ^33 ^7or more times.") FileWrite("demo/MP/vPlaybind.cfg",'"') Sleep(1755) Send("{Home}") FileDelete("demo/MP/vPlaybind.cfg") _SendAdmin() EndFunc Func _SendAdmin() $s_FileName = _TempFile("demo/MP/", "vPlaybind", ".cfg") FileWrite("demo/MP/vPlaybind.cfg",'rcon "') FileWrite("demo/MP/vPlaybind.cfg","^3[^3AdminBot^3]^7: ID: ^3" & $userName & " ^7has been ^3Reported^7 to an Admin.") FileWrite("demo/MP/vPlaybind.cfg",'"') Sleep(1755) ;This is where i would add the TCP message or whatever I need to do. _GetStatus() EndFunc
DarkAngel Posted April 26, 2011 Posted April 26, 2011 Errr /... support for bots isn't really allowed !
wakillon Posted April 26, 2011 Posted April 26, 2011 You must read this before ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Mumms Posted April 27, 2011 Author Posted April 27, 2011 (edited) But this isn't a game automation. For example if someone is constantly swearing in our server, I want to message an admin that there is someone doing it. Then the admin will go into the game and check it out. So the Bot is just reading logs and if something it sees is wrong it flags an admin. Thats it P.S - The name doesn't really mean its a bot. Basicly the program is for our admins. ITs annoying to sit and watch the server 24/7 when they have other shit they could be doing. This just messages them when they are needed. Edited April 27, 2011 by Mumms
bwochinski Posted April 28, 2011 Posted April 28, 2011 I assume you're thinking of having some kind of client program the admins would run to connect and wait for messages?It wouldn't have to be a very complex program if all it has to do is connect and wait for notifications, but you then would have to consider how to handle things server side if no admins are connected. Some kind of notice queue that gets dumped on the next admin to connect I imagine.You'll need to check out the TCPListen() and TCPAccept() functions for server side. Also TCPConnect() and TCPRecv() for client side (at the least). Reviewing all of the TCP functions and their examples should really get you started.
Mumms Posted April 28, 2011 Author Posted April 28, 2011 Thanks for the Help, I got it working using a Hamachi VPN. Now is it possible to send color messages like through a GUI, and / or a Sound, if they have the file?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now