12 Sep 11, 05:03PM
Auto-sorry & auto-thanks-man voicecoms script:
Auto-sorry is pretty self explanitory, it will automatically send the sorry voicecom and a custom message to your teammate when you team kill them.
Auto-thanks-man is meant to automatically respond to people who send you a "nice shot" message after you kill them. So if you kill "unarmed" and they send you a "nice shot" message within a certain time frame, the script will automatically send the "thanks man" voicecom and a custom message: for instance "Thanks unarmed!".
This script needs tools.cfg to work. Be sure to read the comments towards the top and make edits to the script where necessary. Please report any problems you have with the script, because a few people have had problems getting it to work (especially curious about linux/mac users). Enjoy! :)
[SELECT ALL] Code:
// Auto-sorry & auto-thanks-man script for AssaultCube 1.1.0.4 or greater by Bukz.
// Requires tools.cfg by V-Man: http://www.akimbo.in/files/index.php?act=view&id=723
auto_sorry_on = 1 // Change to 0 to disable the auto-sorry script.
auto_thank_on = 1 // Change to 0 to disable the auto-thanks-man script.
time_to_check = 10000 // Wait up to 10 seconds for a "nice shot" from the player you killed last. For auto-thanks.
min_message_wait = 1250 // Minimum time to wait (in milliseconds) before sending a message.
max_message_wait = 3000 // Maximum time to wait (in milliseconds) before sending a message.
// The %1 in the two commands below represent the player's name that the messages are directed towards.
sorry_message = [ result (format "Sorry %1!" $arg1) ]
thanks_message = [ result (format "Thanks %1!" $arg1) ]
// Various ways that people say "nice shot" to you. If you find people using different phrases you may
// want to add them to this list for the auto-thanks script to work on them.
ns_messages = [ "Nice shot" "nice shot" "ns" "NS" ]
// Do NOT edit anything below this unless you really know what you're doing!
rndwait = [ result (rrnd $min_message_wait (+ $max_message_wait 1)) ]
kill_messages = "fragged gibbed splattered slashed headshot"
add2conloop [
if (|| $auto_sorry_on $auto_thank_on) [
loop ctl (listlen $kill_messages) [
if $auto_sorry_on [
if_conline_has (format "%1you %2 teammate" (c 3) (at $kill_messages $ctl)) [ // For auto-sorry.
tked_last = (at $conline 3)
sleep (rndwait) [
voicecom sorry (sorry_message $tked_last)
]
]
]
if $auto_thank_on [
if_conline_has (format "you %1" (at $kill_messages $ctl)) but_not teammate [ // For auto-thanks.
last_victim = (at $conline 2)
last_victim_time = (millis)
scanning_ns = 1
] []
]
]
]
]
// For auto-thanks.
add2conloop [
if $auto_thank_on [
if (checkalias last_victim) [
if (&& $scanning_ns (< (- (millis) $last_victim_time) $time_to_check)) [
loop ccl (listlen $ns_messages) [
if_conline_has (format "%1:" $last_victim) and_also (at $ns_messages $ccl) [
sleep (rndwait) [
voicecom (format thanks_%1 (rrnd 1 3)) (thanks_message $last_victim)
]
]
]
] [ scanning_ns = 0 ]
]
]
]
addcheck_msa [ scanning_ns = 0; last_victim_time = 0; last_victim = NULL; tked_last = NULL ]
addlistonquit "auto_sorry_on auto_thank_on time_to_check min_message_wait max_message_wait sorry_message thanks_message ns_messages rndwait kill_messages scanning_ns tked_last last_victim last_victim_time"
// End Auto-sorry & auto-thanks-man script.
Auto-sorry is pretty self explanitory, it will automatically send the sorry voicecom and a custom message to your teammate when you team kill them.
Auto-thanks-man is meant to automatically respond to people who send you a "nice shot" message after you kill them. So if you kill "unarmed" and they send you a "nice shot" message within a certain time frame, the script will automatically send the "thanks man" voicecom and a custom message: for instance "Thanks unarmed!".
This script needs tools.cfg to work. Be sure to read the comments towards the top and make edits to the script where necessary. Please report any problems you have with the script, because a few people have had problems getting it to work (especially curious about linux/mac users). Enjoy! :)