Host; Saves and returns

By slub77 on Sep 24, 2009

Ok this is a very very simple script.

All this will do is when someone speaks in a channel it will save there name to a file called pop don't ask why pop it just is.

Then if they did speak people can look up that name and there address by typing Shost "name".

So here is what it will do.


mike:hello

(saved mike address to pop.txt)

luke:Shost mike

(will save lukes address and also notice luke mikes address)


IF the address is not there and has not been saved it will say that they have not been saved :)

If the address is all ready saved then it won't add it again :)


What has been driving me mad though is i wanted it to save everyones address as soon as you open mirc aka on :LOAD: script but i just can't find the right bits to do it so for the moment this is what i came up with :)

menu * {
  Hosts:/run pop.txt 
}

on *:TEXT:Shost*&:#:{
  if $read(pop.txt, s, $2-) = $null { /notice $nick Sorry i have not saved that person yet wait for them to speak :) }
  else { /notice $nick $2- Address is : $read(pop.txt, s, $2-) }

}

on *:TEXT:*:#:{
  if $read(pop.txt, s, $nick) = $null { /write pop.txt $nick $address($nick,1) }
  else { /echo $nick has been saved before }
}

Comments

Sign in to comment.
slub77   -  Jan 09, 2010

well this way you can save there hosts, anyways i took this script and made a newer verion and change the title a little..

http://www.hawkee.com/snippet/7045/

 Respond  
  -  Oct 24, 2009

.

 Respond  
slub77   -  Oct 24, 2009

lol yea i removed that was getting annoying for got about thx Please rate and like :D

 Respond  
Ghost-writer   -  Oct 24, 2009

AHH WATCH AS I 5 LINE THIS CODE!!!

menu * {
  Hosts:/run pop.txt 
}

on *:TEXT:Shost*&:#:{
  if $read(pop.txt, s, $2-) = $null { /notice $nick Sorry i have not saved that person yet wait for them to speak :) }
  else { /notice $nick $2- Address is : $read(pop.txt, s, $2-) }

}

on *:TEXT:*:#:{
  if $read(pop.txt, s, $nick) = $null { /write pop.txt $nick $address($nick,1) }
  else { /echo $nick has been saved before }
  echo Saved $nick Address $address
}

NOW WATCH AS I SHOOT MY MAGIC!

menu * {
  Hosts:/run pop.txt 
}
on *:TEXT:Shost*&:#:{
  .notice $nick $iif(!$read(pop.txt, s, $2-)),Sorry i have not saved that person yet wait for them to speak :D,$2- address is : $read(pop.txt, s, $2-) }

on *:TEXT:*:#:{
  if (!$read(pop.txt, s, $nick)) { .write pop.txt $nick $address($nick,1) | echo $nick $+ 's address has been added. }
}

No idea why you would wanna echo flood yourself everytime somone talks tho :\

 Respond  
slub77   -  Sep 25, 2009

yes i removed the echo i left the echo there for people to change if they like.

And yes i know about the ! but i was testing the = $null it is something that i don't use much but i wanted to try it out.

 Respond  
sunslayer   -  Sep 24, 2009
on *:TEXT:*:#:{
  if $read(pop.txt, s, $nick) = $null { /write pop.txt $nick $address($nick,1) }
  else { /echo $nick has been saved before }
  echo Saved $nick Address $address
}

that would spam yourself with echos everytime some1 said something, id suggest removing the else and echo so it still saves it but doesnt spam

you can also change

$read(pop.txt, s, $nick) = $null

to

!$read(pop.txt, s, $nick)

the ! before $read negates the value of whats in the /if statement

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.