mIRC Home    About    Download    Register    News    Help

Print Thread
Info #139107 11/01/06 06:42 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
How do i make a bot to pm someone if it triggers it?

like @find <name>

and then i want to build a database so i can add in the info?
Like
Name : Nickname:
Contacts Number: Icq: Msn:

the bot only respon to certain nick only.
is it possible?

Re: Info #139108 11/01/06 06:53 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
its entirely possible

Re: Info #139109 11/01/06 09:33 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
how could i do that?
mind to teach me?

Re: Info #139110 11/01/06 09:49 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
tell me what u want the trigger to be
what nick you want it to work for
how you want to store the lists
and ill see what i can hammer out

i guess ill go ahead and knock out a hash based one for you

Last edited by NeUtRoN_StaR; 11/01/06 10:16 AM.
Re: Info #139111 11/01/06 10:54 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
i got this far its not quite done
i imagine someone else might pick up the job for you
if not ill work on it some more tomorrow
as not to leave you in suspense
Code:
#Hf on
alias Hfon {
  if ($group(#find) == off) {
    .enable #find
    echo 5 -a Hash Find has been turned on.
  }
  else {
    echo 5 -a Hash Find is already on.
  }
}
alias Hfoff {
  if ($group(#find) == on) {
    .disable #find
    echo 5 -a Hash find has been turned off.
  }
  else {
    acho 5 -a Hash find is already off.
  }
}
alias Hfadd {
  if ($hget(find)) {
    var %hf.sub = $$?="Enter the subject's name."
    var %hf.dat = $$?="Enter the information you want for $1 $+ ."    
    hadd find %hf.sub %hf.dat  
    echo 5 -a Entry created for %hf.sub $+ .
    hsave find " $+ $scriptdirfind.hsh"
  }
  else {
    hmake find 100
    var %hf.sub = $$?="Enter the subject's name."
    var %hf.dat = $$?="Enter the information you want for $1 $+ ."    
    hadd find %hf.sub %hf.dat  
    echo 5 -a Entry created for %hf.sub $+ .
    hsave find " $+ $scriptdirfind.hsh"
  }
}
alias Hfdel {
  if ($hget(find)) {
    var %hf.sub = $$?="Name to delete?"
    hdel find %hf.sub
    echo 5 -a Entry for %hf.sub deleted.
  }
  else {
    echo 5 -a Table cannot be found.
    echo 5 -a Entry cannot be present.
  }
}
alias Hfclear {
  if ($hget(find)) { 
    hfree find
    echo 5 -a Table cleared.
  }
}
menu nicklist {
  Hash find
  .On Off
  ..Hf on:Hfon
  ..Hf off:Hfoff
  .Table  
  ..Add:Hfadd 
  ..Delete:Hfdel 
  ..Clear:Hfclear
}
#Hf end

#find on
on *:start: {    
  if ($isfile(find.hsh)) {      
    hmake find 100    
    hload -o find find.hsh  
  }  
  else { 
    hmake find 100
  }
}
on *:exit: { 
  hsave -o find " $+ $scriptdirfind.hsh"  
  hfree find 
}
on *:text:@find &amp;:#: { 
  if (((%aa != on) &amp;&amp; ($hfind(find, $2)) &amp;&amp; ($ulevel &gt;= 4))) {  
    msg $nick : $+ $hget(find, $2) 
    set -u10 %aa on  
  }
  else { 
    if ((%aa != on) &amp;&amp; ($hget(find) == $null)) {   
      msg $nick Subject not found.
      set -u10 %aa on    
      hmake 100 find  
    }
  }
}
#find end


its function as is i guess
i need to look into appending to entries rather than overwriting
and offer that option

for right now it will work you have to set the name of the person you want to have access to level 4 in your user list
im sure the help file can get you there
and as it stands once you make a entry anything else made under the same name will overwrite what was previously there.

goodnight

Last edited by NeUtRoN_StaR; 11/01/06 10:58 AM.
Re: Info #139112 11/01/06 02:28 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
If it possible to register their nick to get access??

Code:
 

on *:text:!register &amp;:?: {
  write users.txt $nick $2
}
on *:text:!login &amp;:?: {
  if ($read(users.txt,s,$nick) == $2) {
    commands to mark user as logged in (variable maybe)
  }
}

 

Re: Info #139113 11/01/06 03:07 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
adding info to the list works fine
but when i try @find
it wont trigger it
not sure what's wrong

I'm still noob hehe

Re: Info #139114 11/01/06 07:44 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Quote:

Hash Find has been turned on.
<I{a|ser> @find nickname
<str|fe> :Contacts Number: Icq: Msn:

works fine for me

Re: Info #139115 11/01/06 07:46 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
well first of all
i put a check in there that sees if the person trying to use it is level 4 or higher in your userlist
secondly you cant trigger a on text event of yours yourself

Re: Info #139116 11/01/06 08:09 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
unless you add an "on input" so you can trip the rest
or use an alias

Re: Info #139117 11/01/06 08:23 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Code:
#login on
on *:text:!register &amp;:?: {
  write users.txt $nick $2
  notice $nick you are now registered; you pass is $2 $+ .
}
on *:text:!login &amp;:?: {
  if ($read(users.txt,s,$nick) == $2) {
    set -u6000 $+(%,hf,$nick) on
    notice $nick Login succesful.  
  }
} 
#login end

#Hf on
alias Hfon {
  if ($group(#find) == off) {
    .enable #find
    echo 5 -a Hash Find has been turned on.
  }
  else {
    echo 5 -a Hash Find is already on.
  }
}
alias Hfoff {
  if ($group(#find) == on) {
    .disable #find
    echo 5 -a Hash find has been turned off.
  }
  else {
    acho 5 -a Hash find is already off.
  }
}
alias Hfadd {
  if ($hget(find)) {
    var %hf.sub = $$?="Enter the subject's name."
    var %hf.dat = $$?="Enter the information you want for $1 $+ ."    
    hadd find %hf.sub %hf.dat  
    echo 5 -a Entry created for %hf.sub $+ .
    hsave find " $+ $scriptdirfind.hsh"
  }
  else {
    hmake find 100
    var %hf.sub = $$?="Enter the subject's name."
    var %hf.dat = $$?="Enter the information you want for $1 $+ ."    
    hadd find %hf.sub %hf.dat  
    echo 5 -a Entry created for %hf.sub $+ .
    hsave find " $+ $scriptdirfind.hsh"
  }
}
alias Hfdel {
  if ($hget(find)) {
    var %hf.sub = $$?="Name to delete?"
    hdel find %hf.sub
    echo 5 -a Entry for %hf.sub deleted.
  }
  else {
    echo 5 -a Table cannot be found.
    echo 5 -a Entry cannot be present.
  }
}
alias Hfclear {
  if ($hget(find)) { 
    hfree find
    echo 5 -a Table cleared.
  }
}
menu nicklist {
  Hash find
  .On Off
  ..Hf on:Hfon
  ..Hf off:Hfoff
  .Table  
  ..Add:Hfadd 
  ..Delete:Hfdel 
  ..Clear:Hfclear
}
#Hf end

#find on
on *:start: {    
  if ($isfile(find.hsh)) {      
    hmake find 100    
    hload -o find find.hsh  
  }  
  else { 
    hmake find 100
  }
}
on *:exit: { 
  hsave -o find " $+ $scriptdirfind.hsh"  
  hfree find 
  unset %hf*
}
on *:text:@find &amp;:*: { 
  if (((%aa != on) &amp;&amp; ($hfind(find, $2)) &amp;&amp; ($($+(%,hf,$nick),2) == on))) {  
    msg $nick : $+ $hget(find, $2) 
    set -u10 %aa on  
  }
  else { 
    if ((%aa != on) &amp;&amp; ($hget(find) == $null)) {   
      set -u10 %aa on    
      hmake 100 find  
    }
  }
}
#find end

Re: Info #139118 11/01/06 11:03 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
let me know if the above suits your needs
it does allow everyone access to your "database"
i hope you realize that
a better way might be to set a global variable to your desired password and then just give that out to the people u want to have access to the database

Last edited by NeUtRoN_StaR; 11/01/06 11:26 PM.
Re: Info #139119 12/01/06 05:45 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
how do i set global?

strange thing was i try to register, it wont move a thing
like !register user pass

Hash Find is already on.
Entry created for ian.
< Ian > @findname ian

i change the trigger to @findname since i have other triger

so far the hfadd works fine with add and deleting

Re: Info #139120 12/01/06 05:49 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
If i want to add more info
i'll just have to add

var %hf.etc = $$?="Enter the information you want for $1 $+ ."

hadd find %hf.sub %hf.dat %hf.etc

right?

Re: Info #139121 12/01/06 07:18 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
the variables are local and therefore cease to exist once the script is done running
so no
i didnt figure the overwriting thing would be a big hurdle for you

based on your login system you have a firm enough grasp that you could make it run off .txt rather than hash thereby making it easier to edit

if not let me know and ill do it
as far as editing goes with .txt you can just open the damn thing and type it in
simple is good

Re: Info #139122 12/01/06 02:21 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
I guess i'll let it open for everyone to use it so i don't have to make the register script.

so far i had install 2 mirc in my pc.
1 is for my personal use and 1 as a bot.
I put in the script in the bot but doesn't respon to me when i use my personel use mirc. like i use @find(before i change it to @findname
Did i do anything wrong?


Re: Info #139123 12/01/06 09:10 PM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Code:
#login on
on *:text:!login &amp;:?: {
  if (%hfpass == $2) {
    set -u6000 $+(%,hf,$nick) on
    notice $nick Login succesful.  
  }
} 
#login end
#Hf on
alias Hfon {
  if ($group(#find) == off) {
    .enable #find
    echo 5 -a Hash Find has been turned on.
  }
  else {
    echo 5 -a Hash Find is already on.
  }
}
alias Hfoff {
  if ($group(#find) == on) {
    .disable #find
    echo 5 -a Hash find has been turned off.
  }
  else {
    acho 5 -a Hash find is already off.
  }
}
alias Hfadd {
  if ($hget(find)) {
    var %hf.sub = $$?="Enter the subject's name."
    var %hf.dat = $$?="Enter the information you want for $1 $+ ."    
    hadd find %hf.sub %hf.dat  
    echo 5 -a Entry created for %hf.sub $+ .
    hsave find " $+ $scriptdirfind.hsh"
  }
  else {
    hmake find 100
    var %hf.sub = $$?="Enter the subject's name."
    var %hf.dat = $$?="Enter the information you want for $1 $+ ."    
    hadd find %hf.sub %hf.dat  
    echo 5 -a Entry created for %hf.sub $+ .
    hsave find " $+ $scriptdirfind.hsh"
  }
}
alias Hfdel {
  if ($hget(find)) {
    var %hf.sub = $$?="Name to delete?"
    hdel find %hf.sub
    echo 5 -a Entry for %hf.sub deleted.
  }
  else {
    echo 5 -a Table cannot be found.
    echo 5 -a Entry cannot be present.
  }
}
alias Hfclear {
  if ($hget(find)) { 
    hfree find
    echo 5 -a Table cleared.
  }
}
menu nicklist {
  Hash find
  .On Off
  ..Hf on:Hfon
  ..Hf off:Hfoff
  .Table  
  ..Add:Hfadd 
  ..Delete:Hfdel 
  ..Clear:Hfclear
  .set pass:set %hfpass $$?="Set your new pass."
}
#Hf end

#find off
on *:start: {    
  if ($isfile(find.hsh)) {      
    hmake find 100    
    hload -o find find.hsh  
  }  
  else { 
    hmake find 100
  }
}
on *:exit: { 
  hsave -o find " $+ $scriptdirfind.hsh"  
  hfree find 
  unset %hf*
}
on *:text:@find &amp;:*: { 
  if (((%aa != on) &amp;&amp; ($hfind(find, $2)) &amp;&amp; ($($+(%,hf,$nick),2) == on))) {  
    msg $nick : $+ $hget(find, $2) 
    set -u10 %aa on  
  }
  else { 
    if ((%aa != on) &amp;&amp; ($hget(find) == $null)) {   
      set -u10 %aa on    
      hmake 100 find  
    }
  }
}
#find end

there it is with the password thing your too lazy to write wink
i dont know why it wouldnt be working for you

Last edited by NeUtRoN_StaR; 12/01/06 09:14 PM.