PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Themaster on 14 December, 2004, 13:09:30

Title: Do REALY NEED SOME help here
Post by: Themaster on 14 December, 2004, 13:09:30
Hello ppl...I do realy need help to my script i need a person that will take some time at look on it and chance what there are to chance and so on
Title:
Post by: Herodes on 14 December, 2004, 14:08:33
post the script somewhere we can get it ..
Title:
Post by: Themaster on 15 December, 2004, 01:08:46
Hello again...i have 3 lua that i wan't you 2 look at and chance what there are 2 chance...

HERE (http://dkthemaster.webbyen.dk/)

i do realy need that help... :(
Remember it is not finish my script
Title:
Post by: [NL]Pur on 15 December, 2004, 11:34:18
is there anything you want too see added or do you have an problem with an error etc.

more details whould be helpfull :)
Title:
Post by: Themaster on 15 December, 2004, 13:50:43
it just it all...just chance what there are 2 be chance..and then added 2 me....i have some small problem on it
Title:
Post by: Herodes on 15 December, 2004, 17:35:29
There are my comments ...

see this :
function flavour(user)
tFlavours = {
"blueberry",
"lemon",
"blackburant",
"forest",
"raspberry",
"caramel",
"mint",
}
SendToAll(" "..user.sName.." drinks his "..tFlavours[random(getn(tFlavours)].." flavoured tea.")
end
compared to this ...
function flavour(user)
   taste = random(7)
      if taste == 1 then
         SendToAll(" " ..user.sName" Drinks tea with blueberry flavour")
      elseif taste == 2 then
SendToAll(" "..user.sName.." drinks tea with lemon flavour")
elseif taste == 3 then
SendToAll(" "..user.sName.." drinks tea with Blackcurramt flavour")
elseif taste == 4 then
SendToAll(" "..user.sName.." drinks tea with forest fruit flavour")
elseif taste == 5 then
SendToAll(" "..user.sName.." drinks tea with raspberry flavour")
elseif taste == 6 then
SendToAll(" "..user.sName.." drinks tea with caramell flavour")
elseif taste == 7 then
SendToAll(" "..user.sName.." drinks tea with mint flavour")
end
end
(In this last one there is a syntax error too ... it came from the Command.lua .. the first "if"
a string concatation goes wrong because of poor syntax ... )

Also in Blade1.1.lua the function Readtextfile is declared twice ... this makes only the declaration closer to the end of the script valid .. the first one completely ignored and reduntant.

In general I think your script is just a "collage" of scripts ...
make your life easier by trying to put up smaller scripts ...
then move on to write ur own bot when you are fully aware of
what you are doing,... that's my personal opinion...

make use of the functions you have ...
for example ReadKicked and ReadKickBan functions in Blade1.1.lua can definately be rendered reduntant
if you call Readtextfile(user, "Blade/logs/Ban.txt"),
(at the same time you may use this function to display any other .txt )

make comments !
comment as much as you can ...
this will make you get used to stuff you already know ..
you'll be able to explain it(what the script does , what the function does ) better to yourself and others too!

GIVE CREDITS !
pitifully I see no credit notes in those functions ...
I know the scirpt isnt ready for disturbuting yet but you are giving it away when you post a link to it .. :(
Title:
Post by: Madman on 15 December, 2004, 18:22:01
QuoteOriginally posted by Herodes
function flavour(user)
tFlavours = {
"blueberry",
"lemon",
"blackburant",
"forest",
"raspberry",
"caramel",
"mint",
}
SendToAll(" "..user.sName.." drinks his "..tFlavours[random(getn(tFlavours)].." flavoured tea.")
end

Who gets the credits for that piece of code?
I'm using it in my script =)
Title:
Post by: Themaster on 15 December, 2004, 23:41:38
i just try to make my own script with a lillte help from another script...
i will give credit for all there are helping me on it..i'm happy for it...