quote socket

By blackvenomm666 on Nov 23, 2010

this is my first socket script its just a random quotes socket put in remotes then type /quotes

alias quotes {
  sockopen quotes www.randomquotes.net 80
  set -u3 %quoters  msg $active 12,1[4,1Random Quotes12,1]

}
on *:sockopen:quotes: {
  sockwrite -n $sockname GET / HTTP/1.1
  sockwrite -n $sockname Host: $+($sock(quotes).addr,$str($crlf,2))
}
on *:sockread:quotes: {
  var %quotes | sockread %quotes
   if ( *<p class="quote">* iswm %quotes) {
    %quoters $remove(%quotes,<p class="quote">,</p>,&nbsp;,quotes[0],=,<body>,<p>,<br/>,<br>,<b>)
    sockclose quotes
  }
}

Comments

Sign in to comment.
Jethro   -  Nov 30, 2010

No problem. I hope you enjoy it.

 Respond  
Jenny   -  Nov 30, 2010

@napa182, no not as far as I know. @Jethro, I did it but still no luck. I ripped an alerter script's timer part and addedit to the original script here and it works. Bulky but it do the job. Thank you for all your help and sorry for being a pain. I am just baffled at why it don't work for me.

 Respond  
napa182   -  Nov 29, 2010

@Jenny by any chance do you use banners something like ex:
.·´¯10 Doom~~Doom ´¯·.

 Respond  
Jethro   -  Nov 29, 2010

Actually you can remove the $decode part of the code...I thought your network had the %# channel types. I forgot to edit it. Even without it, the $+(.timer,$regml(1)) 0 $2 quotes # was supposed to work as it should. I just don't see why it fails to work for you while it works for me and other people, including Dark|.

Anyway, the reason you received "Identifier locked" message is that you have that optioned locked currently.

To unlock it, go to mirc options, expand Other, select Lock, under Disable Commands, uncheck Decode, and then Ok to save. After that, try to run the script again.

 Respond  
blackvenomm666   -  Nov 29, 2010

what site and room can you be found at jenny and whats your nick

 Respond  
Dark|   -  Nov 29, 2010

the new edit works :/
It might be a verison problem?
But it works on the 7.15

 Respond  
Jenny   -  Nov 29, 2010

@Jethro_ Sorry it is still exactly the same. Only show the /quotes in the bots window and not in the channel. The !autoquote and !off don't work. However I loaded it in my own mirc and the the message come that timer is set, but when it must msg i get : * Identifier locked in options dialog: $decode. There must be something wrong on my bot I think.

 Respond  
Jethro   -  Nov 29, 2010

Jenny, use this edit:

alias quotes {
  sockopen quotes www.randomquotes.net 80
  sockmark quotes $iif($active = $1,.msg $1,echo -at) $&
    12,1[4,1Random Quotes12,1]
}
on *:sockopen:quotes:{
  var %quotes sockwrite -n quotes
  %quotes GET / HTTP/1.1
  %quotes Host: $+($sock(quotes).addr,$str($crlf,2))
}
on *:sockread:quotes:{
  var %quotes | sockread %quotes
  if (<p class="quote"> isin %quotes) {
    $sock(quotes).mark $remove($gettok($v2,2,62),<br,</p)
    sockclose quotes
  }
}
on $*:text:/^!(auto)?(quote)\b|(off)$/iS:#:{
  if !%t { inc -u6 %t
    if $regml(1) = quote { quotes # | halt }
    elseif $regml(1) = off {
      if $timer(auto) { .timerauto off | .msg # Auto quote has been turned off! }
      halt
    }
    else { goto $iif(!$2 || $2 !isnum,error,timer) }
    :error | .msg # $nick $+ , please enter a number. e.g. !autoquote 20 $&
      (This sets quote to message in the channel every 20 seconds.) | halt
    :timer
    $+(.timer,$regml(1)) 0 $2 quotes $!decode( $encode(#,m) ,m)
    .msg # Auto quote has been set to message the channel every $2 seconds!
    halt
  }
}

The commands are the same:

/quotes
!autoquote <second>
!off

I suspect you copied the unedited version before I updated it.

 Respond  
Jenny   -  Nov 29, 2010

@ Jethro_All I get is #

 Respond  
Jethro   -  Nov 29, 2010

Jenny, can you tell me what do you get when entering this:

//echo $chantypes

while being connected to your chat network.

 Respond  
Jenny   -  Nov 29, 2010

@Dark| No it gives me nothing, it simply don't work and when I do the /quotes command, it gives the quote in the bots window but does not msg it in the channel

 Respond  
Dark|   -  Nov 28, 2010

@Jenny
in the bots mirc does have a error?
like in invald command quotes?

 Respond  
Jenny   -  Nov 28, 2010

I know what it should look like :) It just don't work like that. I have really tried everything Jethro_ but the best I get is /quotes on the bot's screen in the channel and not in the channel from my own mirc. I wont waste anymore of your time, thank you for helping me I appreciate. I just wish I knew why it don't work.

 Respond  
Jethro   -  Nov 27, 2010

Let's say the bot is called Jenny, and I send the trigger in the channel via my mIRC:> !autoquote 20

Auto quote has been set to message the channel every 20 seconds! [Random Quotes] Our bodies are our gardens to which our wills are gardeners. [Random Quotes] What happens is not as important as how you react to what happens.The number 20 tells the script to send a random quote every 20 seconds. You can adjust it accordingly.
 Respond  
Jenny   -  Nov 27, 2010

I understand that, but it does not. It also just shows the quote in the bots window and not in the channel. If I am trying to activate it from my mirc, nothing happens.

 Respond  
blackvenomm666   -  Nov 27, 2010

yea if only /quotes works that means your trying to run it off of the same irc your using. you need to run it off a different one if you wanna use the other options

 Respond  
Jethro   -  Nov 27, 2010

Jenny, the script I've provided above is designed to be used as a bot, where you run it for people to trigger.

 Respond  
Jenny   -  Nov 27, 2010

Jethro_ it is on irc.easychat.co.za Maybe I am just doing something wrong, but only the /quotes works for me. Is this script for bot or normal mirc?

 Respond  
Jethro   -  Nov 26, 2010

Jenny, I'm not sure why. It's working for me perfectly. What network are you using?

 Respond  
jaytea   -  Nov 25, 2010

still a little old, but the update and full thread about the script is here:

http://forum.swiftirc.net/viewtopic.php?f=34&t=4749

having never used it, i can only vouch for its reliability insofar as i know Chessnut to be a very talented scripter. however, i would agree that its important to gain some familiarity with the overall procedure for data retrieval with mIRC's sockets before attempting to use that.

 Respond  
napa182   -  Nov 25, 2010

they do have a socket maker made by Chessnut back in 2006, but it would be better for people to make their own sockets so they learn an know what it's doing.
anyways here is the link to Simple Socket Script Creator v0.1 by Chessnut he does have an updated version of it, but im not going to look for it.

anyways like i said you should just make the sockets from scratch and don't rely on the socket maker to do it for you.

 Respond  
Gummo   -  Nov 25, 2010

i think someone should make a MSL program that makes the sockets for you, you type in the triggers and websites - Idea!
That's actually really easy up until the point where you decide how each website must be matched. All websites are arranged differently and sometimes the data comes through on more than one message, making that more difficult.
One solution which can't really fail is to always use a file and binvars, but that will make unnecessarily complicated scripts for most applications.

 Respond  
blackvenomm666   -  Nov 25, 2010

[Random Quotes] Stupid people always think they are right. Wise people listen to advice. - Proverbs 12:15

 Respond  
napa182   -  Nov 25, 2010

yes blackvenomm666 did make this socket himself, and yes he did take the advice an help that was offered to him while he made this and made it his own. he wanted to make a socket without the use of regex so We on the server we are on showed him how i even gave him a test socket to a diff site that he took apart and learned from it to make this socket.

Anyways Nice work blackvenomm666 you are getting better at making them. keep it up....

 Respond  
blackvenomm666   -  Nov 24, 2010

yea sunny thats a facts not quotes haha

 Respond  
Sorasyn   -  Nov 24, 2010

Didn't you post another snippet of 'basically' the same thing?

EDIT: Oh XD I see its a facts socket not a quote lol. 9:00 AM at its best aye? Lol

 Respond  
BigSteve   -  Nov 24, 2010

I don't know if I am doing anything wrong, but I loaded it in my bot and only the manual /quotes work. It does not want to do the !quote !autoquote or !off, please help.
are you using colours sometimes even with regex and such the bot wont pick up colours ors banners :) this is an issue I have found with My bot and have had to recode it so it picks them up XD lol

 Respond  
Jenny   -  Nov 24, 2010

Thnx Jethro_ ... I don't know if I am doing anything wrong, but I loaded it in my bot and only the manual /quotes work. It does not want to do the !quote !autoquote or !off, please help.

 Respond  
Jethro   -  Nov 24, 2010

Jenny wrote:> Ok works nice. Would be better if you can have a setting whereby when put on a bot, it will msg the channel every hour or whatever time you choose with a quote. A small on/off menu with timer would make this a great snippet. I would then give it a definite like :)

on $*:text:/^!(auto)?(quote)\b|(off)$/iS:#:{
  if !%t { inc -u6 %t
    if $regml(1) = quote { quotes # | halt }
    elseif $regml(1) = off {
      if $timer(auto) { .timerauto off | .msg # Auto quote has been turned off! }
      halt
    }
    else { goto $iif(!$2 || $2 !isnum,error,timer) }
    :error | .msg # $nick $+ , please enter a number. e.g. !autoquote 20 $&
      (This sets quote to message in the channel every 20 seconds.) | halt
    :timer
    $+(.timer,$regml(1)) 0 $2 quotes #
    .msg # Auto quote has been set to message the channel every $2 seconds!
    halt
  }
}
alias quotes {
  sockopen quotes www.randomquotes.net 80
  sockmark quotes $iif($active = $1,.msg $1,echo -at) 12,1[4,1Random Quotes12,1]
}
on *:sockopen:quotes:{
  var %quotes sockwrite -n quotes
  %quotes GET / HTTP/1.1
  %quotes Host: $+($sock(quotes).addr,$str($crlf,2))
}
on *:sockread:quotes:{
  var %quotes | sockread %quotes
  if (<p class="quote"> isin %quotes) {
    $sock(quotes).mark $remove($gettok($v2,2,62),<br,</p)
    sockclose quotes
  }
}

Now you can have it both ways. For your own use, enter: /quotes

For other people to use:

For manual quote, enter: !quote
For timed quote, enter: !autoquote
To turn timed quote off, enter !off

 Respond  
Slickone   -  Nov 23, 2010

nice work on your first go at a socket blackvenomm666.

 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.