I have a big problem...
I want to create a language file for my bot..
Now it looks like this:
openter = "Operator \"..user.sName..\" has entered the hub."
But in hub i get:
Operator "..user.sName.." has entered the hub.
What shud i do ?
Plz help...
/shipis
Where is some problem? The code does exactly what it should.
Maybe you would like to try:
[size=2]openter = "Operator "..user.sName.." has entered the hub."[/size]
Now i get error :
Syntax Error: attempt to index global `user' (a nil value)
/shipis
Try something like this:
openter = "Operator [USER] has entered the hub."
and in the message sent:
local tmp = gsub(openter, "%b[], user.sName)
SendToAll("Bot", tmp)
wow
too dificult for me :D
but i hope i will get this work after some time...
/shipis
i'm using the next way in my a.i bot
this is placed in OpConnected.
SendToAll(Bot, WELCOME1.." "..user.sName.." "..WELCOME2.." "..frmHub:GetHubName().."|")
and this is in the config file, in your case the language file.
-- default welcome text
WELCOME1 = "Welcomes operator"
WELCOME2 = "here at"
2gether this gives,
<-Bure-> Welcomes operator [TGA-OP]plop here at the golden angel testhub
might be less configurable but on the other hand, harder 2 mess up.
plop
Servaks: how does the OpConnected function look? what have you called the parameter variable? You should cahnge 'user' to that one...
function OpConnected(user)
SendToAll(botname, "Operator "..user.sName.." has entered the hub.")
end
/shipis
That should work like a charm... I dont' think that should give any errors..