Lesson 3 ;)
Blocking the inbuilt functions,
Blocking the functions is using the data arrival as the data is arriving
example
function DataArrival(user,data)
if (strfind(data, "$Kick")) then
return 1
end
end
the above will block kick, but remember it will on block the inbuilt right click
blocking a scripted kick is alot different, anyways, try and stop ban by yourself ;)
hint, it can be accomplished by blocking !ban
Start Learning now.......;)
Ok i have wrote a little task, i am gonna write a script then brake it so it doesnt work...
Then i want you to try fix it and post back, i will make it simple(only newbies please) ;)
Bot = Keiko
Main()
frmHub:RegBotName()
end
function NewUserConnected()
SendToAll ("A User has connected)
end
function OpConnected()
sendtoall("A Op has entered")
end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == !version then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
end
end
end
Ok i have made lots of common mistakes (on purpose) :P
So now i wait for you to try and fix them and post back ;)
Also include the mistakes you have found and fixed, tell me how you realised the mistake and how fixed
Remember im here to help, so if you follow this you will be writing your own scripts in no time ;)
l8rr,,
-phatty
PS : If you are a good scripter, and dying to post back, send me as pm :P
heheehe
first mistake is u don't have a version. e.g. version = "0.2 by ".
Main()
frmHub:RegBotName()
end
the second is dat u can't start a script wid main u need 2 have function in front of it. e.g. functionMain(), and u can't have reg bot name because that won't know the name of the bot. so u will have 2 take "Name" off and put "bot" in brackets.e.g.
function Main()
frmHub:RegBot(Bot)
end
yep thats it ur getting there, now for the rest, keep going :) wd
there is 2 more mistakes ;)
A realy good example, i think i'll have to write a lesson later on, then it get more complex ( then i get my comp up and running that is, i guess it has got quite complex by then)
:)
hehehe :o)
Very nice...
/shipis
QuoteOriginally posted by servaks
Very nice...
/shipis
ahh but have you spotted the other 2 common mistakes ;)
ooops btw theres 3 more mistakes i forgot to say one lol ;)
lol :D
/shipis
The others mistakes are:
1->
function Data Arrival(CurUser,data)
the correct sintax is :
function DataArrival(CurUser,data)
2->
if cmd == !version then
the correct sintax is:
if cmd == "!version" then
i guess it's pretty those! i hope i haven't missed any
xokas over&out
youve missed one more ;)
u r still missing out.
1)
function NewUserConnected()
SendToAll ("A User has connected)
end
u r missing user which should be in barackets after newuser connected.which should be
function NewUserConnected(user)
and then u r missing Bot which should be in brackets.
SendToAll(Bot,. and den in the brackets u have a user has connected which should end in brackets and also have "..user.sName..", 2 show the name of the user.
this is what it should look like.
function NewUserConnected(user)
SendToAll(Bot,"Welcome our new guest "..user.sName..", enyot your stay")
end
yep well done for the last fixe function ;)
more to coem on next lesson
grrrr i have spoted that one but it missed me! maybe next time!
the other 1 is in op connected in brackets u need user e.g. function OpConnected(user).
some of the letters in sendtoall have 2 be capital e.g. SendToAll.
and u need bot in bracketse.g. SendToAll(Bot,
it should all like something like this
function OpConnected(user)
SendToAll(Bot,"Welcome the op "..user.sName..", enjoy your stay")
end
shouldn't it be enjoy not enjot.
lol yep sure heheeh, well done
so when r u posting up the next step 2 creating a bot. the thing is i wnat 2 advance my skills. at the moment i don't know nothing about the sciprts not a lot.so dats y i want 2 learn dem.
ok for a continue on this lesson i will write a bigger one for to let the other keep up here we go, i will make more mistakes, and try hiding a few ;)
Bot = (Keiko)
NEWCON == 1
Main()
frmHub:RegBot(Bos)
end
function NewUserConnected(CurUser)
if NEWCON = 1 then
user:SendData ("A User has connected)
else
end
function OpConnected()
if user.iprofile = 0 then
user:senddata(Bot"Hello..user.sName..How are you"
return 1
else
sendtoall("A Op has entered")
end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,= strfind(data,"%b<>%")
if cmd = "!version" then
user:SendData(Bos,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd = "!help" then
user:SendData(Bos,"This si where the help text wud go, bt im not gonna waste my time :P")
return 1
end
end
ok theres at least 15-16 erros on this one, good luck ;)
btw, have a go, but paste the full thing with all the errors you spot fixed, and please use the [code ] brackets around the code please :o)
i have done it is it right can u have a look.i am sorry but i don't know how 2 do the code thing.
Bot = (Keiko)
version = "0.2 by phatty"
NEWCON = 1
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if NEWCON then
SendToAll(Bot, "A User has connected")
end
function OpConnected(user)
user.iprofile =
SendData(Bot, "Hello..user.sName..How are you")
SendToAll(Bot, "The Op has entered")
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P")
return 1
end
end
end
end
have a look is it right. if it is just give another 1 dat didn't look dat hard.
i have this! if some mistake or error tell me so i can learn ! tkhx
Bot = "Keiko"
NEWCON = 1
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if NEWCON then
user:SendData ("A User has connected")
else
end
function OpConnected()
if user.iprofile then
user:senddata(Bot,"Hello" ..user.sName.. "How are you")
return 1
else
SendToAll("A Op has entered")
end
function DataArrival(User,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text would go, but im not gonna waste my time :P")
return 1
end
end
end
end
end
i just haven't figured out that one:
function OpConnected()
if user.iprofile then
QuoteOriginally posted by raz
have a look is it right. if it is just give another 1 dat didn't look dat hard.
i can see 5 mistakes
wat is newcon? wat does it do?
grrrr one mistake! i missed this
version = "botversion"
ok time to run thru it so you can see the mistakes and save for the next lesson
--you had this
Bot = "Keiko"
NEWCON = 1
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if NEWCON then
user:SendData ("A User has connected")
else
end
function OpConnected()
if user.iprofile then
user:senddata(Bot,"Hello" ..user.sName.. "How are you")
return 1
else
SendToAll("A Op has entered")
end
function DataArrival(User,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text would go, but im not gonna waste my time :P")
return 1
end
end
end
end
end
ok
----this is fine
Bot = "Keiko"
NEWCON = 1
function Main()
frmHub:RegBot(Bot)
end
--------------------
function NewUserConnected(user)
if NEWCON==1 then -- this needed to equal something
user:SendData (Bot,"A User has connected") --bot name/not important
else
end
end -- missing an end
-----------------------
function OpConnected(user) -- missing user
if user.iprofile==0 then --the user profile for the profiles.dat file
user:SendData(Bot,"Hello " ..user.sName.. " How are you") --cap sensitive for senddata
return 1
else
SendToAll("A Op has entered")
end
end --another end
------------------------
function DataArrival(User,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text would go, but im not gonna waste my time :P")
return 1
end
end
end
end
there ya go now you can study and learn from it, wait until next lesson i will start asap, and try make it alot better and longer ;)
-War3zMantis
almost there yep :)))
yep ;) both doin good for only the third lesson, and this is the simple stuff, better to come yet ;)
let me have them let me have them :P i take them all out :) just kiding
i admit dat i should of got "end" but i needed a bit of help on the other 2. which i didn't know
well has this helped you understadn it better? :)
this just shows that it ain't easy and u shouldn't try 2 get it done quickly cuz u might skip something. post next one up 2morrow. safe chat wid u 2morrrow.
hehe well if i get time i will start a redo of lesson 4 but make better, as i did put 2 in one, i was in a rush so i will spreadt it out and make a better lesson 4 ;)
for me the next one can come anytime!let them cum to me! :P
if you use the tag [code ] and [/code] then it's much esier to read the code, use tab as well so the code looks like this:
Bot = "(Keiko)" -- missing "" to show that it is a string
NEWCON = 1
Main()
frmHub:RegBot(Bot) -- spelling misstake on Bot
end
function NewUserConnected(CurUser)
if NEWCON == 1 then -- use dubble equal signs then compareing
user:SendData ("A User has connected") -- missed a " at the end of the text string
else
end
end -- missing end
function OpConnected()
if user.iProfile == 0 then -- need duble '=' again and iProfile is case sensitive
user:SendData(Bot,"Hello..user.sName..How are you") --Case sensitive function call + missing ')' in the end
return 1
else
SendToAll(Bot,"A Op has entered") -- function name senttoall ned to be SendToAll, case sensitive
end
end -- missing end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)") -- regular exp. wasn't used correctly and missing cmd variable
if cmd == "!version" then -- missing one '=' again
user:SendData(Bot,"This bot is Learn to write a bot version: "..version) --misspelled bot again and missing a declaration of version before using it..
return 1
elseif cmd == "!help" then -- missing one '=' again
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P") -- misspelled bot again
return 1
end
end
end -- missing an end
and not like
Bot = "(Keiko)" -- missing "" to show that it is a string
NEWCON = 1
Main()
frmHub:RegBot(Bot) -- spelling misstake on Bot
end
function NewUserConnected(CurUser)
if NEWCON == 1 then -- use dubble equal signs then compareing
user:SendData ("A User has connected") -- missed a " at the end of the text string
else
end
end -- missing end
function OpConnected()
if user.iProfile == 0 then -- need duble '=' again and iProfile is case sensitive
user:SendData(Bot,"Hello..user.sName..How are you") --Case sensitive function call + missing ')' in the end
return 1
else
SendToAll(Bot,"A Op has entered") -- function name senttoall ned to be SendToAll, case sensitive
end
end -- missing end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)") -- regular exp. wasn't used correctly and missing cmd variable
if cmd == "!version" then -- missing one '=' again
user:SendData(Bot,"This bot is Learn to write a bot version: "..version) --misspelled bot again and missing a declaration of version before using it..
return 1
elseif cmd == "!help" then -- missing one '=' again
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P") -- misspelled bot again
return 1
end
end
end -- missing an end
//Skrollster
tkhx for the hint skrollster! gonna try to do better on the nexts times! tkhx a lot again
QuoteOriginally posted by xokas
tkhx for the hint skrollster! gonna try to do better on the nexts times! tkhx a lot again
Weclome back Xokas aka ...... :)
and phatty go on with the lessons :)
its great :D
hey hey hey! is it a star? a plane?its superman? maybe a flying saucer? RUN PEOPLE IT'S AC!
h? h? h?! im back indeed AC, nice to see ya around here too! :]
QuoteOriginally posted by Skrollster
if you use the tag [code ] and [/code] then it's much esier to read the code, use tab as well so the code looks like this:
Bot = "(Keiko)" -- missing "" to show that it is a string
NEWCON == 1
Main()
frmHub:RegBot(Bot) -- spelling misstake on Bot
end
function NewUserConnected(CurUser)
if NEWCON == 1 then -- use dubble equal signs then compareing
user:SendData ("A User has connected") -- missed a " at the end of the text string
else
end
end -- missing end
function OpConnected()
if user.iProfile == 0 then -- need duble '=' again and iProfile is case sensitive
user:SendData(Bot,"Hello..user.sName..How are you") --Case sensitive function call + missing ')' in the end
return 1
else
SendToAll(Bot,"A Op has entered") -- function name senttoall ned to be SendToAll, case sensitive
end
end -- missing end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)") -- regular exp. wasn't used correctly and missing cmd variable
if cmd == "!version" then -- missing one '=' again
user:SendData(Bot,"This bot is Learn to write a bot version: "..version) --misspelled bot again and missing a declaration of version before using it..
return 1
elseif cmd == "!help" then -- missing one '=' again
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P") -- misspelled bot again
return 1
end
end
end -- missing an end
and not like
Bot = "(Keiko)" -- missing "" to show that it is a string
NEWCON == 1
Main()
frmHub:RegBot(Bot) -- spelling misstake on Bot
end
function NewUserConnected(CurUser)
if NEWCON == 1 then -- use dubble equal signs then compareing
user:SendData ("A User has connected") -- missed a " at the end of the text string
else
end
end -- missing end
function OpConnected()
if user.iProfile == 0 then -- need duble '=' again and iProfile is case sensitive
user:SendData(Bot,"Hello..user.sName..How are you") --Case sensitive function call + missing ')' in the end
return 1
else
SendToAll(Bot,"A Op has entered") -- function name senttoall ned to be SendToAll, case sensitive
end
end -- missing end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)") -- regular exp. wasn't used correctly and missing cmd variable
if cmd == "!version" then -- missing one '=' again
user:SendData(Bot,"This bot is Learn to write a bot version: "..version) --misspelled bot again and missing a declaration of version before using it..
return 1
elseif cmd == "!help" then -- missing one '=' again
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P") -- misspelled bot again
return 1
end
end
end -- missing an end
//Skrollster
hehehe Skrollster :P
whats this
NEWCON == 1 :P
NEWCON = 1
QuoteOriginally posted by AlwaysConnected
QuoteOriginally posted by xokas
tkhx for the hint skrollster! gonna try to do better on the nexts times! tkhx a lot again
Weclome back Xokas aka ...... :)
and phatty go on with the lessons :)
its great :D
yep sure course i will m8, just installing linux for the next few hours, bloody drivers brrrrrrrrrrrrrr
Phatty move ya phatty ass! c'mon! ehehehhe
just kidding
QuoteOriginally posted by xokas
Phatty move ya phatty ass! c'mon! ehehehhe
just kidding
You cheeky tw@ :P
nah have liux to install, seems bill wants to be a tw@ iand i dont like windows, so fk it, goodbye windows ehehehehe
yes phatty so whens the next lesson coming i am ready for this time i was in a hurry last time cuz i had 2 go 2 my otha house. put lesson 4 on. i am waiting for it.
QuoteOriginally posted by (uk-kingdom)pH?tt?
hehehe Skrollster :P
whats this
NEWCON == 1 :P
NEWCON = 1
i still corrected more buggs then you knew where there :P
where?
this is your fix:
----this is fine
Bot = "Keiko"
NEWCON = 1
function Main()
frmHub:RegBot(Bot)
end
--------------------
function NewUserConnected(user)
if NEWCON==1 then -- this needed to equal something
user:SendData (Bot,"A User has connected") --bot name/not important
else
end
end -- missing an end
-----------------------
function OpConnected(user) -- missing user
if user.iprofile==0 then --the user profile for the profiles.dat file
user:SendData(Bot,"Hello " ..user.sName.. " How are you") --cap sensitive for senddata
return 1
else
SendToAll("A Op has entered")
end
end --another end
------------------------
function DataArrival(User,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text would go, but im not gonna waste my time :P")
return 1
end
end
end
end
and this is mine:
Bot = "(Keiko)" -- missing "" to show that it is a string
NEWCON = 1
Main()
frmHub:RegBot(Bot) -- spelling misstake on Bot
end
function NewUserConnected(CurUser)
if NEWCON == 1 then -- use dubble equal signs then compareing
user:SendData ("A User has connected") -- missed a " at the end of the text string
else
end
end -- missing end
function OpConnected()
if user.iProfile == 0 then -- need duble '=' again and iProfile is case sensitive
user:SendData(Bot,"Hello..user.sName..How are you") --Case sensitive function call + missing ')' in the end
return 1
else
SendToAll(Bot,"A Op has entered") -- function name senttoall ned to be SendToAll, case sensitive
end
end -- missing end
function Data Arrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)") -- regular exp. wasn't used correctly and missing cmd variable
if cmd == "!version" then -- missing one '=' again
user:SendData(Bot,"This bot is Learn to write a bot version: "..version) --misspelled bot again and missing a declaration of version before using it..
return 1
elseif cmd == "!help" then -- missing one '=' again
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P") -- misspelled bot again
return 1
end
end
end -- missing an end
you have one end too much, haven't declared version, using iprofile instead of iProfile.. probably more, but i don't have time..
so when is the next lesson coming. put it up 2day :D
well i have an excuse, im tired, not slept in 4 days agen brrrrrrrrrrrrrrrrr, my big 2 day sleep coming up lol
mmm, testing this bot and still giving errorssss
gone give a update
btw,
function NewUserConnected(CurUser) --// mmm (CurUser)
user:SendData ("A User has connected") --// mm (user)
---- some 1 forgot the part (function)
Main()
must be
function Main()
---- And a other 1
function Data Arrival(user,data)
must be
function DataArrival(user,data)
---- you are asking for a version?
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
Syntax Error: attempt to concat global `version' (a nil value)
so there needs to be something like: version = "0.3"
----- Last 1, function OpConnected() - must be function OpConnected(user)
bla bla :D
New try....
Bot = "(Keiko)"
version = "0.3"
NEWCON = 1
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if NEWCON == 1 then
user:SendData (Bot,"A User has connected")
end
end
function OpConnected(user)
if user.iProfile == 0 then
user:SendData(Bot,"Hello Master "..user.sName.." How are you")
return 1
else
SendToAll(Bot,"A Op has entered")
end
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P")
return 1
end
end
end
In some programming languages one '=' is enough for an if test... *offtopic comment*
YW :]
so when is write you own bot = lesson 4 coming. been waiting 4 a little while now. ?(
When i het some time, might be today, still sorting linux, its been a tw@ been told my modem not got the linux drivers for it out, so im getting someone to write some now, shud be done soon i hope :o)
Then i will start with lesson 4, as i got some plans for it ;)
btw heres a little extra
Bot = "Keiko"
version = "0.3"
NEWCON = 1
prefix = "!"
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
if NEWCON == 1 then
user:SendData (Bot,"A User has connected")
end
end
function OpConnected(user)
if user.iProfile == 0 then
user:SendData(Bot,"Hello Master "..user.sName.." How are you")
return 1
else
SendToAll(Bot,"A Op has entered")
end
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == prefix.."version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == prefix.."help" then
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P")
return 1
end
end
end
but ill explain more on next lesson ;)
not so tired now :o)
i wish it gets done quickly, so i can create my own bot sooon. :P
Bot = "Keiko"
version = "voltron"
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user)
SendToAll(Bot, "A User has connected, welcome "..user.sName.." stand up and cheer.")
end
function OpConnected(user)
SendToAll(Bot,"Master of all that is peersharing "..user.sName.." has entered the hub.")
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
end
end
end
ok i got some of it right off hand but the protions i was having problems with are
this is what i used:
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
end
end
end
this was your nonworkingone:
if cmd == !version then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
end
i added the "" to the version
i cant see the diffrence is the two functions.
can you point it out.
Look at the ends
QuoteOriginally posted by (uk-kingdom)pH?tt?
Look at the ends
AAHHHHH
how could i have missed that
what is the diffrence of
=
and
==
and when would you use them.
user = 2
if user == 1 then
ok guys i know im behind
i was left back in prekindergarden.....heeheee :D :D
but i cannot get
!version or
!help to show what is in the script
!version show errors and !help
shows the ptokax inbuilt commands
with error
"Syntax Error: attempt to index global `user' (a nil value)"
so the return1
is not working and i tried it with my script and
skrollster's
function DataArrival(CurUser,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == "!version" then
user:SendData(Bot,"This bot is Learn to write a bot version: "..version)
return 1
elseif cmd == "!help" then
user:SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P")
return 1
end
end
end
your problem lies here:
function DataArrival(CurUser ,data)
(by the way this line is wrong, it should be:
function DataArrival(curUser ,data)
user :SendData(Bot,"This bot is Learn to write a bot version: "..version)
user :SendData(Bot,"This is where the help text wud go, bt im not gonna waste my time :P")
looking at various scripts you notice some use user
and some curUser...
in your case, you have in your function curUser
so all user Data sending should be entered with (curUser not user try that...
/NightLitch
@NightLitch
yup that got it working
thanks
so for any new funtion
if you define the function with curUser
every string has to have curUser?
if yes
then curUser and user are basically the same thing?
except when in a function.
ok for example if i make
function DataArrival(user,data)
then its
user:SendPM
if i made
function DataArrival(Num,Nuts)
then it wud be
Num:SendPM
hope that helps ;)
i dont think i ever caught what
NEWCON =1
means, im guessing if stands for new connection,
but why have that when you already have a
function for:
function NewUserConnected(user)
NEWCON = 1 is not a function is a variable
look for if NEWCON == 1 then
then watch what it does, then try change NEWCON = 1 to NEWCON = 0 also check the first ever lesson it is explained somewhere along the lines.
you must be skipping because tere is alot you dont understand, and asking questions on things that is in the last lessons ;)
go back and read slowly and carefully ;)
-phatty
QuoteOriginally posted by (uk-kingdom)pH?tt?
NEWCON = 1 is not a function is a variable
look for if NEWCON == 1 then
then watch what it does, then try change NEWCON = 1 to NEWCON = 0 also check the first ever lesson it is explained somewhere along the lines.
you must be skipping because tere is alot you dont understand, and asking questions on things that is in the last lessons ;)
go back and read slowly and carefully ;)
-phatty
lol i am reading slowly and carefully
and i go over the lessons over and over and over
again "..user.sName.." has the time to learn this
while i am at work.
the there is no explanation of what NEWCON is
it only shows up on one of the bots in lesson three
and then some butting heads between you and skrollster.
I enjoy your lessons and i appreciate that you do this, you really tailor it for nobbies like myself but you have to be prepared for questions. :D :] :))
i just dont want to write the code
i want to understand what it does?
hahah ok, :o)
i will make a lesson of it, lesson 7 will be on them ;)
--Welcomes
-- Users
welcome_users = "Hi ?s ?rezd j?l magad"
-- OPs
welcome_op_1 = ""
welcome_op_2 = ""
welcome_op_3 = ""
welcome_op_4 = ""
welcome_op_5 = ""
function NewUserConnected(user)
if Connectusermess == 1 then
SendToAll(Bot, user.sName..""..welcome_users)
end
end
----------------
if ConnectOpmess == 1 then
function OpConnected(user)
Pillock = GetProfileName(user.iProfile)
MessOp = random(5)
SendToAll(Bot,_________) --<--This is the qestion ?( ... What I have to write there ? welcome_op_(??? this is the number Mess OP)
end
end
end
----Thx