Mumms
Active Members-
Posts
59 -
Joined
-
Last visited
Mumms's Achievements
Wayfarer (2/7)
0
Reputation
-
Hey, I'm getting the same error as listed above, here is my code: Func sendColours($msg) colors() If $msg <> "" Then For $Ox = 0 to UBound($SOCKET) - 1 If $SOCKET[$Ox] <> "" Then If TCPSend($SOCKET[$Ox], "COLOURS" & $c1 & $c2 & $c3 & $c4) == 0 And @error Then TCPCloseSocket($SOCKET[$Ox]) _ArrayDelete($SOCKET,$Ox) _ArrayDelete($NICKS,$Ox) Sleep(1000) EndIf EndIf Next EndIf EndFunc Any Help?
-
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?
-
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.
-
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 Func 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
-
Thanks for the fast response.
-
There are no errors when I Syntex Check, and I can compile this and run it. But Then I get an error saying that a variable has be used without being declared. . Logicly This should work, as far as I can tell and it shouldn't be giving me this error. Any help with fixing this? Thanks.
-
On Most modems, there is a button called "standby". When pressed it blocks you from receiving interet until pressed again. Is there anyway you could write a program that copied the standby button? Any hints?
-
@sahsanu Thank you so much! your script worked perfectly. Can you explain how you made the pattern work though? @everyone else Thank you very much for posting. Your scripts have gave me new ideas that I will most likely use! Once again thanks for the help
-
Thanks for all the help, but Its not quite what I'm looking for. Sure your code works when you know what the Text is. But this is a log file so I don't always know what "mixx" would be. So here is what i want to do. I want to get a returned string that is from the first ^7 to the left of "^7 was shot by Mumms" so for example this is what it would say in the log file. "^7Some Name Here^7was shot by Mumms" So i want it to return "^7Some Name Here" So im searching for "^7was shot by Mumms" in the log file and then i need to go to the left until the next ^7 and then get that string that is inbetween those two spots. Sorry I don't know how to explain this properly, So im trying to make it as simple as possible. Thanks again!
-
So here is what I want to do: I get the postion of the string in the string I search. (StringInStr) I want to go to the left of that substring until I get to the next ^7 Then I want to get the string that is inbetween the two "^7" Here is what I have so far: FileGetTime($file) If Not @error Then FileOpen($file, 0) $line = FileReadLine($file, -1) $wik = StringInStr($line, "^7 was shot by " & $User, 2) If $wik > 1 Then ;####This is where I need help :p#### Sleep(2500) EndIf Sorry if this doesn't make much sense. *Edit I added this hopefully to explain more* ^7mixx^7 was shot by Mumms ~> This is an example of a line in the file im reading Mumms = $User in script So lets say that the return value for $wik was 10. I want to go left until the next ^7 so that would be 4? And then i want to stringsplit or something so that I only get: "mixx"
-
for $i = 0 to stringlen($line) $getBadChar = stringmid($line,($fp + 4),$i) If $getBadChar = "e" or "^" or StringIsUpper($getBadChar) or StringIsDigit($getBadChar) Then ;This is where I want to get the postion of where the $getBadChar is so that I can get a string that starts at ; ($fp + 4) and ends at ($getBadChar - 1) EndIf Any Help?
-
Thanks for all of the help but I'm having problems :/ This is the error I got when I tried to run my program. Error: Subscript used with non-Array variable. Func getColors() FileGetTime("demo/MP/qconsole.log") If Not @error Then FileOpen("demo/MP/qconsole.log", 0) $line2 = FileReadLine($file, -1) $fairplayline = StringInStr($line2, "fairplay", 2) $fairplayline = ($fairplayline - 2) If $fairplayline > 1 Then If $fpcolor = stringmid($line2,$fairplayline,1) Then for $i = 0 to stringlen($line2) If $fpcolor = "^" Then $fpcolor = stringmid($line2, ($fairplayline + 1),1) EndIf Next EndIf EndIf EndIf bind() EndFunc Little Help?
-
I am opening a file and reading it, and I get this line from the file I am reading.: ^*^6fairplay ^Nchris ^&14:32:08 ^<demobase.eu What I need is the charactor after the ^ only. (so the 6, N, &, < ) I don't want any other part of the string. I've tried to split up this string but it is not really working. Are there any other methods to get the charactors after the ^
-
Thank you for all the replies, It has really helpped!