Author Topic: HOW-TO : Write your own Bot = Lesson 1  (Read 11037 times)

0 Members and 1 Guest are viewing this topic.

Offline speedX

  • Lord
  • ***
  • Posts: 437
  • Karma: +59/-19
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #25 on: 13 November, 2006, 15:05:20 »
Thx for the help Naithif

My guess would be that more people read these here than in the wiki

Yup even I agree to this :)
Thanking You,

speedX

PtokaX forum

Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #25 on: 13 November, 2006, 15:05:20 »

Offline Naithif

  • Triple Ace
  • **
  • Posts: 199
  • Karma: +32/-13
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #26 on: 13 November, 2006, 15:17:17 »
You're welcome  :)

Offline Cêñoßy†ê

  • Scripter
  • Triple Ace
  • ******
  • Posts: 190
  • Karma: +31/-3
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #27 on: 13 November, 2006, 15:28:27 »
Code: [Select]
rank = GetProfileName(user.iProfile)
if rank == nil then rank = "User"; user:SendData(Bot,"Welcome "..rank.." "..user.sName)
else user:SendData(Bot,"Welcome "..rank.." User "..user.sName); end

or like this:
Code: [Select]
user:SendData(Bot,"Welcome "..(GetProfileName(user.iProfile) or "User").." "..user.sName)
***********************
Powered By Leviathan v5.2 ;)

Offline Naithif

  • Triple Ace
  • **
  • Posts: 199
  • Karma: +32/-13
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #28 on: 13 November, 2006, 15:35:41 »
Nice idea :D
I could have shorten it too (not this much though :D), but he asked for "Reg User" and this extension should go only to Reg and VIP

Offline speedX

  • Lord
  • ***
  • Posts: 437
  • Karma: +59/-19
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #29 on: 13 November, 2006, 15:48:39 »
And wat code to show Welcome Operator speedX or Master speedX?
Thanking You,

speedX

Offline Naithif

  • Triple Ace
  • **
  • Posts: 199
  • Karma: +32/-13
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #30 on: 13 November, 2006, 16:09:08 »
You can use any of them

Code: [Select]
rank = GetProfileName(user.iProfile)
user:SendData(Bot,"Welcome "..rank.." "..user.sName)
(No chance for nil because operator on login can't be user :D)


C??o?y??'s code is good as he pasted it there above
Code: [Select]
user:SendData(Bot,"Welcome "..(GetProfileName(user.iProfile) or "User").." "..user.sName)

Offline jack_port1000

  • Fulll Member
  • ****
  • Posts: 67
  • Karma: +4/-0
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #31 on: 20 June, 2007, 18:02:57 »
is tat possible to add color in words if yes then in this script some error

[21:21] Syntax ... and Settings\SWAGAT.JAGIRDAR\Desktop\New Folder (3)\scripts\welcome.lua:15: ']' expected near '='



Bot = "1st"



function NewUserConnected(user)

SendToAll(Bot,"Welcome our new guest "..user.sName..", enyot your stay")


end

function OpConnected(user)

SendToAll(Bot,"Welcome our Op "..user.sName.. " hope he enjoys his stay")


end


Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Emperor
  • **
  • Posts: 1 054
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
Re: HOW-TO : Write your own Bot = Lesson 1
« Reply #32 on: 20 June, 2007, 18:12:48 »
no you cannot add colors by scripting
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Offline JamespaX

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-1
HOW TO Write your own Bot Lesson 1
« Reply #33 on: 26 March, 2017, 01:20:43 »
Hi does anyone know how I can get into the chat room?

Thank you

PtokaX forum

HOW TO Write your own Bot Lesson 1
« Reply #33 on: 26 March, 2017, 01:20:43 »