PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: UwV on 26 February, 2005, 23:07:06

Title: really ?
Post by: UwV on 26 February, 2005, 23:07:06
i,.. me ?  .. really ??  the first to post here in this section ???  ;0)

--TrigChat 1.0
--by Mutor
--Add / Remove triggers as you wish.
-- little customizing & conv. to lua5 by UwW (nothing much)
--
--
--
---Editable Section---------------------
botname = "-=Holly-Helps=-" -- Change this to your main bot
 
tTrigs = {
        shit = "Hey [User]! Watch the language. Dont use words like that in here please.",
        fuck = "Hey [User]! Watch the language. Dont use words like that in here please.",
        goodnight = "Goodnight, [User]. Sleep well.",
        Goodnight = "Goodnight, [User]. Sleep well.",
        ["anyone have"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone got"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone get"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["got to go"] = "Alright, later, [User]",
        ["XP Fire"] = "\r\n\r\nTo disable the XP firewall, follow these steps \r\n*****************************************************\r\n- Double click 'My Network Places'\r\n- Click 'View Network Connections'\r\n- Right click on 'Local Area Connection and Select 'Properties'\r\n- Click the 'Advanced' tab\r\n- Make sure to uncheck the box under 'Internet Connection Firewall'\r\n",
        ["hidden tag"] = "\r\n\r\n    Hiding client tags:\r\n******************************\r\nA tag is the DC++ tag, i.e. <++ V:0.305,M:A,H:0/1/0,S:2\r\n\r\nA faker can simply be defined as, having a false misleading or fraudulent appearance. That being\r\nsaid,a tag faker is someone who either hides or fraudulently modifies their DC++ tag. OPs typically\r\ndisallow hidden tag clients from entering a hub or will simply permanently ban on sightany user\r\nwho is found doing this.\r\n",
        ["setup active"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        ["forward a port"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        ["port map"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        trigs = "\r\n---<>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<>---\r\n\ AVAILABLE TRIGS -> brb , bbiab , bbiaw , kk , wb , Hi , Hi , hey , Hey , hello , Hi , Hello , goodnight , Goodnight , Goodnight, g'ni , \r\n Nite , nite , bye , cya , gtg , g2g , whats up , any slot , no slot , peace , lol , lmao , rofl , haha , hehe , lag , a drink , see ya , \r\n good bye , anyone have , anyone got ,anyone get , got to go , got to go , later , c ya , needs sleep , need sleep , zz , Zz ,\r\n damn , regist , Yo , my list , my file list , search my file , active mode , passive mode ,peer , xp fire , XP Fire , XP fire , the icons ,\r\n user icons , commands , tags , extra slot , slot lock , slotlock , share fak , sharefak , hidden tag , setup active , forward a port , \r\n port map ,  port , hashing , file hashing , trigs \r\n---<>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<>---\r\n",
        }
---End Editable scetion--------------
---Dont edit below unless you know what your doing 8-)
--

function Main()
        --frmHub:RegBot(botname)
end

--// function ChatArrival(user, data)
function ChatArrival(user, data)
        if string.sub(data, 1, 1) == "<" then
        local s, e, pre = string.find(data, "^%b<> (.)")
       if pre == "!" or pre == "+" or pre == "/" or pre == "?" or user.sName == "3?" then return end --// user.sName == "3?"   stops the replying to mutlichatrelay use your own multichatbotnick here ..
                data=string.gsub(data,1,string.len(data)-1)
                s,e,msg = string.find(data,"%s+(%S+)")
                trigfound=0
                -- check for trigs in table
                for key, value in tTrigs do --
                        if( string.find( data, key) ) then
                        answer, x = string.gsub(value,"%b[]", user.sName)--
                        user:SendData( botname, answer ) --//sends reply's to user only,..  to send to all change for:  sendtoall(botname, answer)
                        trigfound=1
                        break
                        end
                end
                if (trigfound==0)then
                end
        end
end
[/SIZE]
obviously many trigs removed due to maximium post lenght ..
but finding the lua4 version is easy( www.plop.nl)  (http://www.plop.nl)  and it has all the original triggers and reply's ..  ..
Title:
Post by: DEEP-GOA on 26 February, 2005, 23:35:56
Good work UwV
Title:
Post by: uffetjur on 27 February, 2005, 23:17:37
think u need to add a time delay, bot answers before the post appear in chat window
Title: need ?
Post by: UwV on 28 February, 2005, 00:45:13
me i like it like that ..

like it knows what you are about to say ..  oooh *psychic* ..

but i would make it for you if you need it ?
..  i would actually not 'know' how but i guess i could work it out by rtfm ..
Title:
Post by: ??????Hawk?????? on 28 February, 2005, 01:03:45
hi UwV

try editing your first post and change the quote tags for  code tags  ..

will make for easier reading  



 :P  :P  :P  :P


??????Hawk??????
Title:
Post by: UwV on 28 February, 2005, 02:15:08
QuoteOriginally posted by ??????Hawk??????
hi UwV

try editing your first post and change the quote tags for  code tags  ..

will make for easier reading  



 :P  :P  :P  :P


??????Hawk??????

but like hell to post a reply .. ;0)
now is like scroll or die ...
Title:
Post by: the_pest on 06 March, 2005, 11:52:46
another Triggerbot created by ptaczek (http://www.pestypest.info/ptokax/triggerbot.lua)
it  has delays before answers  (http://fdc.webhop.net/kuru.gif)
Title:
Post by: jiten on 28 April, 2005, 14:59:38
--modded a bit by jiten
--TrigChat 1.0
--by Mutor
--Add / Remove triggers as you wish.
-- little customizing & conv. to lua5 by UwW (nothing much)
--
---Editable Section---------------------
botname = "-=Holly-Helps=-" -- Change this to your main bot
 
tTrigs = {
        shit = "Hey [User]! Watch the language. Dont use words like that in here please.",
        fuck = "Hey [User]! Watch the language. Dont use words like that in here please.",
        goodnight = "Goodnight, [User]. Sleep well.",
        Goodnight = "Goodnight, [User]. Sleep well.",
        ["anyone have"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone got"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone get"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["got to go"] = "Alright, later, [User]",
        ["XP Fire"] = "\r\n\r\nTo disable the XP firewall, follow these steps \r\n*****************************************************\r\n- Double click 'My Network Places'\r\n- Click 'View Network Connections'\r\n- Right click on 'Local Area Connection and Select 'Properties'\r\n- Click the 'Advanced' tab\r\n- Make sure to uncheck the box under 'Internet Connection Firewall'\r\n",
        ["hidden tag"] = "\r\n\r\n    Hiding client tags:\r\n******************************\r\nA tag is the DC++ tag, i.e. <++ V:0.305,M:A,H:0/1/0,S:2\r\n\r\nA faker can simply be defined as, having a false misleading or fraudulent appearance. That being\r\nsaid,a tag faker is someone who either hides or fraudulently modifies their DC++ tag. OPs typically\r\ndisallow hidden tag clients from entering a hub or will simply permanently ban on sightany user\r\nwho is found doing this.\r\n",
        ["setup active"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        ["forward a port"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        ["port map"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        trigs = "\r\n---<>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<>---\r\n\ AVAILABLE TRIGS -> brb , bbiab , bbiaw , kk , wb , Hi , Hi , hey , Hey , hello , Hi , Hello , goodnight , Goodnight , Goodnight, g'ni , \r\n Nite , nite , bye , cya , gtg , g2g , whats up , any slot , no slot , peace , lol , lmao , rofl , haha , hehe , lag , a drink , see ya , \r\n good bye , anyone have , anyone got ,anyone get , got to go , got to go , later , c ya , needs sleep , need sleep , zz , Zz ,\r\n damn , regist , Yo , my list , my file list , search my file , active mode , passive mode ,peer , xp fire , XP Fire , XP fire , the icons ,\r\n user icons , commands , tags , extra slot , slot lock , slotlock , share fak , sharefak , hidden tag , setup active , forward a port , \r\n port map ,  port , hashing , file hashing , trigs \r\n---<>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<>---\r\n",
        }
---End Editable scetion--------------
---Dont edit below unless you know what your doing 8-)

function Main()
        --frmHub:RegBot(botname)
end

--// function ChatArrival(user, data)
function ChatArrival(user, data)
local data = string.sub(data,1,-2)
local s,e,msg = string.find(data,"%s+(%S+)")
-- check for trigs in table
if not iscommand(msg) then
for key, value in tTrigs do
if( string.find( data, key) ) then
answer, x = string.gsub(value,"%b[]", user.sName)
SendToAll(user.sName,msg)
user:SendData( botname, answer ) -- message sent to user only
--SendToAll(botname, answer) -- message sent to everyone
return 1
end
end
end
end

function iscommand(str)  
return string.sub(str, 1, 1) == "!" or string.sub(str, 1, 1) == "+" or string.sub(str, 1, 1) == "/" or string.sub(str, 1, 1) == "?" or string.sub(str, 1, 1) == "3?"  
end
Cheers
Title: ?
Post by: (-=TrIp-iN-SuN=-) on 28 April, 2005, 21:12:01
how i doing to all users see what bot answer for same user
Title:
Post by: jiten on 28 April, 2005, 21:25:33
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
how i doing to all users see what bot answer for same user
Change this in ChatArrival:
user:SendData( botname, answer ) -- message sent to user only
--SendToAll(botname, answer) -- message sent to everyone

to
--user:SendData( botname, answer ) -- message sent to user only
SendToAll(botname, answer) -- message sent to everyone
Cheers
Title: Re: really ?
Post by: INFERNOUS on 29 August, 2006, 03:37:42
Hi! I know that this is old theam but I hope someone would help me!
In the second type of script when turning on - SENDTOALL first word sending and the others are not!

for example - i type "anyone have"  - and see in chat:

[05:18:01] <INF2> anyone
[05:18:01] <-=Holly-Helps=-> INF2, please use the search tool, instead of making requests in main chat.

"HAVE" disapperes - it happens with all phrases, which includes more than 1 word

I was trying to find it, but without results, cause i don't now LUA!

ps: sorry for my language)
Title: Re:
Post by: Herodes on 29 August, 2006, 09:24:20
--modded a bit by jiten
--TrigChat 1.0
--by Mutor
--Add / Remove triggers as you wish.
-- little customizing & conv. to lua5 by UwW (nothing much)
--
--- Herodes touch:
--- removed iscommand function
--- fixed the regexp for catching more than one word...
---Editable Section---------------------
botname = "-=Holly-Helps=-" -- Change this to your main bot

tTrigs = {
        shit = "Hey [User]! Watch the language. Dont use words like that in here please.",
        fuck = "Hey [User]! Watch the language. Dont use words like that in here please.",
        goodnight = "Goodnight, [User]. Sleep well.",
        Goodnight = "Goodnight, [User]. Sleep well.",
        ["anyone have"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone got"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone get"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["got to go"] = "Alright, later, [User]",
        ["XP Fire"] = "\r\n\r\nTo disable the XP firewall, follow these steps \r\n*****************************************************\r\n- Double click 'My Network Places'\r\n- Click 'View Network Connections'\r\n- Right click on 'Local Area Connection and Select 'Properties'\r\n- Click the 'Advanced' tab\r\n- Make sure to uncheck the box under 'Internet Connection Firewall'\r\n",
        ["hidden tag"] = "\r\n\r\n    Hiding client tags:\r\n******************************\r\nA tag is the DC++ tag, i.e. <++ V:0.305,M:A,H:0/1/0,S:2\r\n\r\nA faker can simply be defined as, having a false misleading or fraudulent appearance. That being\r\nsaid,a tag faker is someone who either hides or fraudulently modifies their DC++ tag. OPs typically\r\ndisallow hidden tag clients from entering a hub or will simply permanently ban on sightany user\r\nwho is found doing this.\r\n",
        ["setup active"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        ["forward a port"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        ["port map"] = "\r\n\r\n\t**Active mode requires both TCP and UDP access on the same port for DC++ to work properly\r\n\r\n * First you need to set up the router to forward the connections to the computer with DC++. This could\r\n   be called Port mapping, port redirecting, port forwarding or something like that. Find out how to do\r\n   this with your router/NAT in the user manual.\r\n\r\n * You need to forward one port (select a number between 150 - 65535, they should mostly all be free.\r\n   The default port is 411, but it is wise to select a unique one) and make sure both UDP and TCP is\r\n    forwarded to your client.\r\n\r\n * The IP that you are forwarding to should be the internal IP address of your DC++ computer. It usually\r\n   begins with '192.168', '172.16.' or '10.x.'. Go to the command prompt and type: ipconfig.\r\n\r\n * When you have mapped a port, you need to open up DC++ and go to the settings. Where you select\r\n   active mode, in the port field, enter the port number that you are forwarding on the router.\r\n\r\n * In the IP field, you need to enter the external IP address of your router. This can can normally be found\r\n   on the router/firewall 'Status' page.\r\n\r\n * It should now be working. If it is working for a while, but the next time you use DC++, you only get\r\n   'Connection Timeout?s or no results when searching, your IP (either external or internal) is likely to have\r\n    changed. If you find the external IP is constantly changing, you can set yourself up with a dynamic name.\r\n   Such as Dynip or DynDns and put that name into the IP field. Make sure to use a program that\r\n   updates the dynamic name service with your latest IP.\r\n",
        trigs = "\r\n---<>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<>---\r\n\ AVAILABLE TRIGS -> brb , bbiab , bbiaw , kk , wb , Hi , Hi , hey , Hey , hello , Hi , Hello , goodnight , Goodnight , Goodnight, g'ni , \r\n Nite , nite , bye , cya , gtg , g2g , whats up , any slot , no slot , peace , lol , lmao , rofl , haha , hehe , lag , a drink , see ya , \r\n good bye , anyone have , anyone got ,anyone get , got to go , got to go , later , c ya , needs sleep , need sleep , zz , Zz ,\r\n damn , regist , Yo , my list , my file list , search my file , active mode , passive mode ,peer , xp fire , XP Fire , XP fire , the icons ,\r\n user icons , commands , tags , extra slot , slot lock , slotlock , share fak , sharefak , hidden tag , setup active , forward a port , \r\n port map ,  port , hashing , file hashing , trigs \r\n---<>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<>---\r\n",
        }
---End Editable scetion--------------
---Dont edit below unless you know what your doing 8-)

function Main()
        --frmHub:RegBot(botname)
end

--// function ChatArrival(user, data)
function ChatArrival(user, data)
data = string.sub(data,1,-2)
local s,e, msg = string.find(data,"%b<>%s+(.+)")
if not string.find( msg, "^[%!%+%/%?%-%.%#].+") then
for key, value in tTrigs do
if( string.match( string.lower(msg), string.lower(key) ) ) then
answer, x = string.gsub( value,"%b[]", user.sName)
SendToAll(user.sName, msg)
user:SendData( botname, answer ) -- message sent to user only
--SendToAll(botname, answer) -- message sent to everyone
return 1
end
end
end
end
try this one inferous... haven't tested a bit of it ...
Title: Re: really ?
Post by: INFERNOUS on 29 August, 2006, 10:48:13
Thanks, but it's not working!   :-[

[12:46] Syntax ...oks\scripts\valeria.lua:42: attempt to call field `match' (a nil value)


Title: Re: really ?
Post by: Herodes on 29 August, 2006, 11:06:47
Quote from: INFERNOUS on 29 August, 2006, 10:48:13
Thanks, but it's not working!   :-[
[12:46] Syntax ...oks\scripts\valeria.lua:42: attempt to call field `match' (a nil value)
Change
if( string.match( string.lower(msg), string.lower(key) ) ) then
to
if( string.find( string.lower(msg), string.lower(key) ) ) then

I suppose you don't use the 5.1 lua version of PtX are you ?
Title: Re:
Post by: Thor on 29 August, 2006, 11:19:07
But, why you mixed it? In line 40 you used string.find, in line 42 string.match... :)
Title: Re:
Post by: Herodes on 29 August, 2006, 11:44:54
Quote from: Hungarista on 29 August, 2006, 11:19:07
But, why you mixed it? In line 40 you used string.find, in line 42 string.match... :)
hmm .. who knows ? maybe I am rushing to get some drawings for the office ready too ... :)
Title: Re: really ?
Post by: jiten on 29 August, 2006, 12:19:29
Another attempt:

ChatArrival = function(user, data)
if not string.find(data, "^%b<>%s%p.+|$") then
local sMsg
for trig, v in pairs(tTrigs) do
if string.find(string.lower(string.sub(data, (string.len(user.sName)+4), -2)), string.lower(trig), 1, true) then
sMsg = string.gsub(v, "%[User%]", user.sName); break
end
end
if sMsg then
SendToAll(data)
-- Send to main for everyone
SendToAll(botname, sMsg)
-- Message only sent to user
-- user:SendData(botname, sMsg)
return 1
end
end
end
Title: Re: really ?
Post by: Herodes on 29 August, 2006, 12:44:12
good stuff jiten, nice ;)
Title: Re: really ?
Post by: modular on 29 August, 2006, 13:14:35

--TrigChat 1.0
--by Mutor
--Add / Remove triggers as you wish.
-- little customizing & conv. to lua5 - 5.1 by UwW (nothing much)
--
--
--
---Editable Section---------------------
sBotName = "-=Holly-Helps=-" -- Change this to your main bot
iRegBot = nil -- nil to not show , use 1 to show bot in userlist

-- table with nicks not to get "bottered" usefull for multichatbots

tNot = {
["Multichatbotname"] = 1,
["AnotherNick"] = 1,
["And_So_On"] = 1,
}

tTrigs = {
        shit = "Hey [User]! Watch the language. Dont use words like that in here please.",
        fuck = "Hey [User]! Watch the language. Dont use words like that in here please.",
        goodnight = "Goodnight, [User]. Sleep well.",
        ["anyone have"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone got"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["anyone get"] = "[User], please use the search tool, instead of making requests in main chat.",
        ["got to go"] = "Alright, later, [User]",
        }
---End Editable section--------------
---Dont edit below unless you know what your doing 8-)
--

function Main()
        if iRegBot then
                frmHub:RegBot(sBotname)
        end
end
function OnExit()
        if iRegBot then
                frmHub:UnregBot(sBotname)
        end
end

--// function ChatArrival(user, data)
function ChatArrival(user, data)
       if not tNot[user.sName] then
              local _,_, pre = string.find(data, "^%b<> (%p)")
              if not pre then
                     data=string.gsub(data,1,string.len(data)-1)
                     s,e,msg = string.find(data,"%s+(%S+)")
                     -- check for trigs in table
                     for key, value in(tTrigs) do --
                     if( string.find( string.lower(data), key) ) then
                            answer, x = string.gsub(value,"%b[]", user.sName)
                            user:SendData( botname, answer ) --//sends reply's to user only,..  to send to all change for:  SendToAll(botname, answer)
                            break
                            return 1;
                     end
              end
        end
end

obviously many trigs removed due to maximium post lenght ..
but finding the lua4 version is easy( www.plop.nl)  (http://www.plop.nl)  and it has all the original triggers and reply's ..  ..

Title: Re: really ?
Post by: bastya_elvtars on 29 August, 2006, 13:56:00
Quote from: modular on 29 August, 2006, 13:14:35
obviously many trigs removed due to maximium post lenght ..

Haha, months ago everyone whined because there were no attachments, now no one wants to use them. Corss purposes...