Problems with variables
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Problems with variables

Started by servaks, 20 October, 2003, 09:07:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

servaks

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
My hub is back! (yeeeeeey)

hub.servaks.com


ptaczek

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]
-ptaczek-

This whole physical universe is a hologram.
[Cosmosis - Contact: The First Step]

servaks

#2
Now i get error :
Syntax Error: attempt to index global `user' (a nil value)

/shipis
My hub is back! (yeeeeeey)

hub.servaks.com


OpiumVolage

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)

servaks

wow
too dificult for me :D

but i hope i will get this work after some time...

/shipis
My hub is back! (yeeeeeey)

hub.servaks.com


plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

klownietklowniet

Servaks: how does the OpConnected function look? what have you called the parameter variable? You should cahnge 'user' to that one...
[ > DC - UniteD < ]

servaks

function OpConnected(user)
	SendToAll(botname, "Operator "..user.sName.." has entered the hub.") 
end

/shipis
My hub is back! (yeeeeeey)

hub.servaks.com


klownietklowniet

That should work like a charm... I dont' think that should give any errors..
[ > DC - UniteD < ]

SMF spam blocked by CleanTalk