Toribash
Originally Posted by SrgtCorn View Post
I agree and disagree. If an admin of the server takes it as a joke and asks you to stop, but the bot continues, you'd be left with some explaining to do. Screw that idea.

Now that I think about it, an even more practical script would be to modify the current AFK kick script to put a tag next to your name that says "AFK", or to push a button to put "AFK" next to their name. The only problem with this though is that everyone would need to get it to make it work, so it would somehow have to be incorporated in an auto update or something of that sort.

Hmm.... This gives me another idea. I've heard of other people who have made auto type things such as the "rapid emote" script that can put in a command on button push, and I've heard of others who do this for the admin passcode. Maybe if I modify it to do the login function, but with "AFK" already in it, you can just push a button and then go in specs.

EDIT: *sigh* Like always, I make a script, same format as the other. Like always, I change 1 minor thing. Like always, the script won't work. Like always, the stderr says nothing to my advantage.

What's wrong this time?
--Auto AFK
--By SrgtCorn
--Follow the directions for this to work!

local function keydown(key)
    if(key == 267) then
        run_cmd("lo AFKyour_name_here your_password_here") --For this to work right, replace "your_name_here" and "your_password_here"  with your FULL username (tags and all) , space, and then your password. Don't lend this script to someone!
end
    if(key == 268) then
        run_cmd("spec")
end
end


echo("Auto AFK")
echo("By SrgtCorn")
echo("Press "/" to put on the AFK tag and "*" to go into the spectators. These are on the KEYPAD!") 

add_hook("key_down", "keypressdown", keydown)

You cant use " in echo's
use two '

--Auto AFK
--By SrgtCorn
--Follow the directions for this to work!

local function keydown(key)
    if(key == 267) then
        run_cmd("lo AFKyour_name_here your_password_here") --For this to work right, replace "your_name_here" and "your_password_here"  with your FULL username (tags and all) , space, and then your password. Don't lend this script to someone!
    end
    if(key == 268) then
        run_cmd("spec")
    end
end


echo("Auto AFK")
echo("By SrgtCorn")
echo("Press ''/'' to put on the AFK tag and ''*'' to go into the spectators. These are on the KEYPAD!")

add_hook("key_down", "keypressdown", keydown)
:D
Originally Posted by Blam View Post
You cant use " in echo's
use two '

--Auto AFK
--By SrgtCorn
--Follow the directions for this to work!

local function keydown(key)
    if(key == 267) then
        run_cmd("lo AFKyour_name_here your_password_here") --For this to work right, replace "your_name_here" and "your_password_here"  with your FULL username (tags and all) , space, and then your password. Don't lend this script to someone!
    end
    if(key == 268) then
        run_cmd("spec")
    end
end


echo("Auto AFK")
echo("By SrgtCorn")
echo("Press ''/'' to put on the AFK tag and ''*'' to go into the spectators. These are on the KEYPAD!")

add_hook("key_down", "keypressdown", keydown)

Is it always such a simple mistake? -.-

YAY! It works! I should have a finished version done after some testing.
[CBK]
function console(chat,type)
    Textlog = io.open("log.txt", "a+") 'Opens the file "log.txt". the a+ bit means that it writes at the bottom, and doesnt clear the text.
    Textlog:write(chat .. "\n") ' Writes the chat and then a new line (\n)
    Textlog:close() 'Closes the text file.
end

add_hook("console","omgconsole",console)
Last edited by Blam; Jul 30, 2008 at 07:06 PM.
:D
Lua script error in file chatarchiver.lua: data/script/chatarchiver.lua:15: '<eof>' expected near 'end'
Lua script error in file chatarchiver.lua: data/script/chatarchiver.lua:15: '<eof>' expected near 'end'
Lua script error in file chatarchiver.lua: data/script/chatarchiver.lua:15: '<eof>' expected near 'end'
This has popped up many times in the stderr and I can't figure out what it wants me to do.

Also, where would the log.txt file be?

Here's the script so far.
--Chat Archiver
--By SrgtCorn
--Saves what is said in chat to a text file. Useful for reporting rule-breaking activity or for quotes in signatures.

local function keydown(key)
			if (key == 117) then
				run_cmd("echo Recoding...")
end
run_cmd("function console(chat,type)")
    Textlog = io.open("log.txt", "a+") --Opens the file "log.txt". the a+ bit means that it writes at the bottom, and doesnt clear the text.
    Textlog:write(s .. "\n") --Writes the chat and then a new line (\n)
    Textlog:close() --Closes the text file.
end
				run_cmd("echo Complete")
end
end

echo("Chat Archiver")
echo("By SrgtCorn")
echo("Press U to record. Saves what is said in chat to a text file. Useful for reporting rule-breaking activity or for quotes in signatures.")

add_hook("console","omgconsole",console)
add_hook("key_down", "keypressdown", keydown)
Last edited by SrgtCorn; Jul 29, 2008 at 11:23 PM.
[CBK]
You can use " in echos, although the exact details I'm not completely certain on.

However, most likely, it's like any other programming language, in which case this will work:

echo("\"")

Also: SrgtCorn:

run_cmd("function console(chat,type)")

It does not work.

Also, don't use run_cmd("echo Complete"), echo("Complete") is there for that. It also won't retrigger the console trigger for sure.

The end after Textlog:close() needs to disappear, as does one of the ends after run_cmd("echo Complete").
Last edited by suomynona; Jul 30, 2008 at 05:09 PM.
Squad Squad Squad lead?
The standardization of Toribash Squad roles may have gone too far!
Originally Posted by suomynona View Post
You can use " in echos, although the exact details I'm not completely certain on.

However, most likely, it's like any other programming language, in which case this will work:

echo("\"")

Also: SrgtCorn:

run_cmd("function console(chat,type)")

It does not work.

Also, don't use run_cmd("echo Complete"), echo("Complete") is there for that. It also won't retrigger the console trigger for sure.

The end after Textlog:close() needs to disappear, as does one of the ends after run_cmd("echo Complete").

Well, I did what you said and it worked...kind of. It starts up fine, and when I press U it says "Recording...", but I wait and wait and it never says complete. And then when I look in log.txt, its blank. I even waited 5 minutes for the chat box the get heftily filled, pressed U, looked in the log and, nothing. The stderr said this:

Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
parse_cmd no op found SERVER 0; 127.0.0.1:20185 notset

parse_cmd no op found SERVER 0; 127.0.0.1:20195 notset

timeout to connect: WSAGetLastError 10061
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
Lua script error: data/script/chatarchiver.lua:12: attempt to concatenate global 's' (a nil value)
[CBK]
replace s with "chat" (without the speech marks)
:D
Yay! it works! Thank y'all for your help.

EDIT: The first recording. =P

JustCola: corn
[CBK-C97]SrgtCorn: everyone start talking a lot
JustCola: contract right elbow
Kre: haha
Recoding...
Kre: u have not anti-leg
JustCola: i got
JustCola: :)
Kre: go training more
JustCola: but i used anti hs
JustCola: now
JustCola: I GOT NOOB
Kre: u fail xD
JustCola: u can''t read?
JustCola: corn
Kre: yeah
JustCola: tourney
JustCola: !!!!
JustCola: :D
Recoding...
Kre: next i'll do antibody+antihs
JustCola: lol
JustCola: joke?
JustCola: then
Kre: no
JustCola: where u will shot?
JustCola: :D
JustCola: SAY
JustCola: or no space
JustCola: :D
Kre: see
JustCola: say
JustCola: lo
YAY! it works!
JustCola: corn?
archlurps: space?
[CBK]
3 questions this time:

1. Is it possible to make a script take a screenshot every x seconds?
2. Is it possible for a messege to display after a certain number of wins in a row or timeframe?

EDIT: 3. What do you write to make a timer or set a delay?
Last edited by SrgtCorn; Jul 31, 2008 at 11:50 PM.
[CBK]