I made a little bit of an adjustment to Rybacks script. It stll has the old stuff, but it incorporated Rybacks script and it should work properly together. I kept the same wait commands as Ryback had since you all suggested the original caused lag.
BTW, why do you have the mid thread included? It doesn't even look like you're using it??
//By RyBack , James, Elgan.
//I don't think of any othe comments so enjoy!
level waittill spawn
// instr
// instr will find the position in wich a string is found at.
// usage: waitexec global/strings.scr::instr (str string to find) ( str string ) ( int start position )
// returns the position of string_to_find
// eg
// exec global/strings.scr::instr "\" "hell\o"
// gives 4 because it starts at 0
// if none found it will return NIL
//stolen from elgan's strings.scr
instr local.char local.string local.startpos:
if(local.string == "")
{
end
}
if(local.startpos == NIL)
{
local.startpos = 0
}
if(local.startpos > local.string.size)
{
end
}
if(local.startpos < 0)
{
local.startpos = 0
}
//how many do we need?
local.sizeneeded = local.char.size
//need is
local.sofar = 0
//where we found it
local.position = 0
//println ( "INSTRU : Needed is: \"" + local.sizeneeded + "\" IN \"" )
for(local.i = local.startpos; local.i <= local.string.size - 1; local.i++)
{
local.position = local.i - (local.sizeneeded - 1)
//println ( "FINDING : \"" + local.char[local.sofar] + "\" IN \"" + local.string[local.i] + "\" at pos " + local.position + " so far is: " + local.sofar )
if(local.char[local.sofar] == local.string[local.i])
{
//println " - found"
//how many found?
local.sofar++
//is this our first matching char
if(local.sofar == 1)
{
//this is our first character
local.position = local.i
}
if(local.sofar != local.sizeneeded)
{
continue
}
//set out position
//where are we at, take how many chars long the string to find was, minus 1,
// if find 1, take 0, if find 3, we are at 1, moved 3 = 4, take 3
//done
end local.position
}
else
{
//reset so far
local.sofar = 0
}
}
end
//mid
//mid will return a string from a given position for a given number of characters.
// usage: local.string = waitexec global/strings.scr::mid ( start pos, string, count)
// returns: the string from start pos of string along the count.
//
//eg
// local.string = waitexec global/strings.scr 2 "hello" 2
// local.string would become 'll'
//stolen from elgan's strings.scr
mid local.start local.string local.count:
//init string
local.mid = ""
for(local.i = 1; local.i <= local.count;local.i++)
{
if(local.start >( local.string.size - 1 ))
{
break
}
local.mid += local.string[local.start]
local.start++
}
end local.mid
main:
if(level.cvar_check != NIL)
end
level.cvar_check = 1
// It's nicest to make a table with the cvars
// and their values (do not put this inside a while
// loop as that would be very detrimental to
// performance (cpu))
local.vars = makeArray
wambot 0
wbmenu 0
wb_aim1 99999
wb_aim2 99999
wb_pingprediction 99999
wb_aimbot 0
wb_autoshoot 0
wb_fov 0
r_farplane_nofog 0
r_farplane 0
r_farplane_nocull 0
cg_3rd_person 0
r_overbrightbits 0
r_light_nolight 0
endArray
local.accum = 0
local.n = 1 // this sets how many stufftexts will be sent per frame
while(1)
{
for(local.i=1; local.i <= $player.size; local.i++)
{
// this makes sure we will be referencing the same
// player during our check, which now
// covers multiple server frames
local.p = $player[local.i]
local.ui = local.p.userinfo
// set all vars, one per frame
// of course you could change this to more
// than one per frame for faster aimbot resets
// (by incrementing local.n),
// just keep in mind each line adds a little bit of lag
// you may also include more than one
// stufftext command in a single packet:
// local.p stufftext "set var1 a; set var2 b"
// but I believe the game does this optimization
// automatically (stufftexts are accumulated
// and then sent at the end of the server frame)
// so afaik there's no gain from
// combining sets manually.
for(local.j = 1; local.p && local.j <= local.vars.size; local.j++)
{
local.pos = thread instr local.vars[local.j][1] local.ui
local.p stufftext ("set " + local.vars[local.j][1] + " " + local.vars[local.j][2])
if(local.pos != NIL && local.pos != NULL)
{
local.pos += local.vars[local.j][1].size + 1
if(local.ui[local.pos] != local.vars[local.j][2])
{
stuffsrv ("clientkickr " + getclientnum(local.p) + " " + "Kicked for using a unallowed cvar"
break;
}
}
else
{
waitframe
local.player stufftext ("setu " + local.vars[local.j][1] + " " + local.vars[local.j][2])
}
// this is a little 'trick' to evenly throttle the number
// of stufftexts per frame.
//this will work for any number of players,
// any number of vars and any number of n
local.accum++
local.accum = local.accum%local.n
if(local.accum==0)
{
waitframe
}
}
}
wait 3
}
end