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>, ,quotes[0],=,<body>,<p>,<br/>,<br>,<b>)
sockclose quotes
}
}
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.
@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.
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.
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.
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.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.
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.
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.
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....
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
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