Query forwarding 1.1

By RubixCube on Sep 29, 2007

Really simple query dialog that pops up when someone msgs you. It gives you the option to add a user to a friends list so that it automatically ignores the dialog if the user is in the friends list. You also have the option to remove a friend from the list by typing /del_nick (nick). Editing is fine, just give proper credit or a link to this snippet.

dialog quer_ {
  title "Query forwarding"
  size -1 -1 105 62
  option dbu 
  box "", 1, 2 1 101 60, disable
  button "Yes", 4, 6 42 23 12
  button "No", 5, 29 42 23 12
  button "Add as friend", 6, 52 42 35 12
  edit "", 3, 7 21 87 17, read vsbar
  edit "", 2, 8 8 86 10, read
}

on *:dialog:quer_:init:0:{ 
  did -a $dname 2 Query from %nick_ 
  did -a $dname 3 Saying: %message_
}

on *:dialog:quer_:sclick:*:{ 
  if ($did = 4) {
    unset %message_
    dialog -x quer_ quer_
    query %nick_
    .msg %nick_ Your query has been accepted.
    unset %nick_
  }
  if ($did = 5) { 
    unset %message_
    dialog -x quer_ quer_
    .msg %nick_ Your query has been declined. 
    unset %nick_
  }
  if ($did = 6) { 
    if (!$hget(query)) hmake query 500 
    .hadd -m query %nick_ Friend.
    dialog -x quer_ quer_
    query %nick_
    .msg %nick_ Your query has been accepted and you are now added to the acceptance list.  
    unset %message_ %nick_
  }
}

on *:open:?:{ 
  if ($hget(query,$nick) = Friend.) halt 
  else {
    set %nick_ $nick
    set %message_ $1-
    dialog -m quer_ quer_
    .close -m %nick_ 
  }
}

alias del_nick {
  if ($hget(query)) { 
    if ($1) && ($hget(query,$1)) { 
      hdel query $1
    }
  }
}

on *:EXIT:{
  if ($hget(query)) { 
    hsave -o query query.hsh
  }
}

on *:START:{ 
 if (!$hget(query)) hmake query 500
 hload query query.hsh
}

Comments

Sign in to comment.
EL   -  Jun 28, 2008

@smallvillefan28,you can edit your first post now hawkee got a upgrade.`-.-´

 Respond  
smallvillefan28   -  Jun 28, 2008

sorry

2) save it to mirc dir defualts scripts query friends.txt or mirc dir defualts scripts query blocked.txt

 Respond  
smallvillefan28   -  Jun 28, 2008

hmm nice script but is there away you can make a few changes like

1) make a blocked list

2) save it to mirc dir\defualts\scripts\query\friends.txt or mirc dir\defualts\scripts\query\blocked.txt

3) have it save them as !ident@.domain (ie !someone@.dial1.dallas3.level3.net) instead of Nick?

 Respond  
grapee   -  Apr 06, 2008

Nice job, man! It was really useful. I have one question though. Can you put something, a button maybe, for the friends\' list? So we would know who\'s on our list. If you have updated this, kindly let me know. I would really appreciate that. Thanks a lot, dude! 10/10.

-grapee

 Respond  
Olliegod   -  Oct 03, 2007

The reason it produces an error message for /hload is because you do not check if the file exists before you load it.

if ($isfile(query.hsh)) hload query query.hsh
 Respond  
Akishoot   -  Sep 30, 2007

I made one of these awhile ago. It just didn\'t have the friend feature. Never bothered to post it on here, either. I think I will scurry around my folders and try to find it. :o

 Respond  
RubixCube   -  Sep 30, 2007

No problem Akishoot, glad to help.

 Respond  
Akishoot   -  Sep 30, 2007

Ahh thank you, RubixCube. I never did understand what dbu was for. xD

 Respond  
guest598594   -  Sep 30, 2007

hmm thats wierd

 Respond  
RubixCube   -  Sep 30, 2007

Hmm, \'Botquery\' shows that you have edited the snippet a bit. Perhaps the first hash name was loaded instead of Botquery? This snippet doesn\'t use botquery as it\'s hash name so it is most likely you forgot to change one of the names.

 Respond  
guest598594   -  Sep 30, 2007

Could you tell me the error message you received?

  • /hload: unable to open file \'C:\Documents and Settings\Dylan Kirby\Desktop\Trivia Bot\query.hsh\' (line 68, script56.mrc)
 Respond  
RubixCube   -  Sep 30, 2007

Akishoot

I removed dbu and notheme and put pixels, but the dialog shrunk a lot. So I just left it alone and set it back to dbu and notheme. Hehe. :]

That\'s what dbu does. It formats the dialog to fit your current screen resolution, if you removed it the size would be the actual provided.

 Respond  
RubixCube   -  Sep 30, 2007

Could you tell me the error message you received?

 Respond  
RubixCube   -  Sep 30, 2007

Ah the notheme, I use a program called deditor because I am way too lazy. It pretty much includes that usually and I forgot to filter that out. =/

And about the load, the events were last minute and not tested. I am sorry for the efficiency of the snippet right now and will get to work immediately. Thank you all for your feedback.

 Respond  
guest598594   -  Sep 30, 2007

i prefer taking the notheme out, idk why someone would like it that way!

 Respond  
Akishoot   -  Sep 30, 2007

I removed dbu and notheme and put pixels, but the dialog shrunk a lot. So I just left it alone and set it back to dbu and notheme. Hehe. :]

 Respond  
guest598594   -  Sep 30, 2007

good idea to use a dialog with this, very simple

but it gives me error msg on load when it tries to load the hash

and also, why did you choose to make it notheme?

 Respond  
simplicity   -  Sep 30, 2007

Good job. 7/10

 Respond  
RubixCube   -  Sep 30, 2007

Alright, added the events. Thanks Olliegod.

 Respond  
Olliegod   -  Sep 30, 2007

The list of friends will get destroyed when you exit mIRC. You will need to properly save them to file to prevent this, and then reload them from the file once mIRC starts again.

Or you could use a .ini or .txt file for this, seeing as it is something rather simple.

 Respond  
Akishoot   -  Sep 29, 2007

Nice work on this one. Very useful to me. :D 8/10 =)

 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.