frishy

frishy

Joined
Jul 01, 2008

Activity Stream

frishy commented on a Page, English Slang Definition Checker  -  Sep 17, 2011

You put me to shame ):
Good job though!

 Respond  
frishy commented on a Page, !define (slang)  -  Sep 16, 2011

well it has been 4 years since i did it, and i did quit using irc, i didnt know what went wrong with it and it confused me, I had a look since i got an email sayin this has been commented on and worked on it to bring definitions.

The code is below but has some issues but works.
(i cant log into my main account btw)

Updates:
17/9/11-fixed it to show if no definitions were found.

Known issues.
No spacing between examples from the same author
Sometimes sends commands to irc server (seems to be the first world from paragraphs from defining, unsure how to fix)

alias dictionarysearch {
  var %x = 1
  while ($sock($+(dictionary,%x))) inc %x
  sockopen $+(dictionary,%x)  www.urbandictionary.com 80
  sockmark $+(dictionary,%x) $1-
}

ON *:SOCKOPEN:dictionary*: {
  if ($sockerr) {
    var %cmd = $gettok($sock($sockname).mark,1,32)
    %cmd Socket error $sockerr
    return
  }
  sockwrite -n $sockname GET $+(/define.php?term=,$replace(%definition,$chr(32),+) HTTP/1.0)
  sockwrite -n $sockname Host: www.urbandictionary.com
  sockwrite $sockname $crlf
}

on *:SOCKREAD:dictionary*: {
  var %g, %cmd
  %cmd = $gettok($sock($sockname).mark,1,32)
  if ($sockerr) {
    %cmd Socket error $sockerr
    return
  }
  while (1) {
    sockread %g
    if (!$sockbr) break
    if (<div class="definition"> isin %g) {
      inc %defnum
      set %defresult [ $+ [ %defnum ] ] %defresult [ $+ [ %defnum ] ] %defnum $+ $chr(41) $htmlfree($replace(%g,<div class="example">,- $chr(32)))
    }
    if (%defresult3) {
      sockclose $sockname
      %cmd %defresult1
      break
    }

   if (</body> == %g) {
      if (!%defresult1) { set %defresult1 No definition found! }
      sockclose $sockname
      %cmd %defresult1
      break
    }
  }

}

alias dictionary3 { 
  if (%dictionary3) {
    msg %dictionary3 $+(4Definition of %definition,:) 
    var %defnum2 1
    while (%defresult [ $+ [ %defnum2 ] ]) {
      msg %dictionary3 7 %defresult [ $+ [ %defnum2 ] ]
      inc %defnum2
    }
  }
  unset %dictionary3 | unset %defresult* | unset %definition | unset %defnum
}

on *:TEXT:!define*:#: {
  if (%definition) { .notice $nick sorry please wait a sec, defining in progress }
  elseif (!%defspam [ $+ [ $chan $+ [ $nick $+ [ $hash($1-,32) ] ] ] ]) { 
    inc -u20 %defspam [ $+ [ $chan $+ [ $nick $+ [ $hash($1-,32) ] ] ] ]
    set %dictionary3 $chan
    set %definition $2-
    dictionarysearch dictionary3 $2-
  }
  else { .notice $nick sorry but you cant define that word again so quick! }
}

alias -l htmlfree {
  var %x, %i = $regsub($replace($1-,&amp;,&,&lt;,<,&gt;,>,&quot;,",<td>,$chr(32),<tr>,$chr(20)),/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}
 Respond  
frishy commented on a Page, Give Snippet  -  Jan 25, 2010

.timer 1 2 /say almost there
.timer 1 3 /say almost....
.timer 1 4 /say UGHH
.timer 1 7 /say im there!

i has dirty mind yes

 Respond  
frishy commented on a Page, Give Snippet  -  Jan 25, 2010

ur alias sounds like a porno =p

 Respond  
frishy commented on a Page, Rainbow Text Colourer- Updated  -  Nov 04, 2009

thnx =]

if u prefer to use darker colours u can change the colour scheme easily my changing this line:
var %rainboworder 4,7,8,9,11,6,13

 Respond  
frishy commented on a Page, Rainbow Text Colourer- Updated  -  Oct 29, 2009

it should work, just double checked it and everything seems matched up, try putting it in a new file.

 Respond  
frishy commented on a Page, Rainbow Text Colourer- Updated  -  Oct 29, 2009

FRISH also the email address for that account stopped logging in for some reason, the pass i forgot coz it was generated for me not custom :<

 Respond  
frishy created a Page  -  Oct 29, 2009

This can colour you text in a rainbow sequence. Just load into your remotes (Alt+R).

frishy commented on a Page, Lotto Generator  -  Jan 12, 2009

good work :)

but here's a couple of tips:
You don't need all of the /'s
Using local variables wud be better as they are auto unset when not needed (/var rather than /set)

Also if you want you can replace:

  %num1 = $rand(1,49)
  :tryagainA
  %num2 = $rand(1,49)
  if %num2 = %num1 { /goto tryagainA }
  :tryagainB
  %num3 = $rand(1,49)
  if %num3 = %num2 || %num3 = %num1 { /goto tryagainB }
  :tryagainC
  %num4 = $rand(1,49)
  if %num4 = %num3 || %num4 = %num2 || %num4 = %num1 { /goto tryagainC }
  :tryagainD
  %num5 = $rand(1,49)
  if %num5 = %num4 || %num5 = %num3 || %num5 = %num2 || %num5 = %num1 { /goto tryagainD }
  :tryagainE
  %num6 = $rand(1,49)
  if %num6 = %num5 || %num6 = %num4 || %num6 = %num3 || %num6 = %num2 || %num6 = %num1 { /goto tryagainE }
  :tryagainF
  %num7 = $rand(1,49)
  if %num7 = %num6 || %num7 = %num5 || %num7 = %num4 || %num7 = %num3 || %num7 = %num2 || %num7 = %num1 { /goto tryagainF }
  %chan = $readini($mircdir\lotto.ini, lotto, chan)
  msg %chan Your lucky numbers are:4 %num1 %num2 %num3 %num4 %num5 %num6 ( $+ %num7 $+ )

with

  var %i = 2, %num1 = $r(1,49), %lnumbers = %num1
  while (%i <= 7) {
    var %num [ $+ [ %i ] ] $r(1,49)
    while ($istok(%lnumbers,%num [ $+ [ %i ] ],44)) {
      %num [ $+ [ %i ] ] = $r(1,49)
    }
    %lnumbers = $addtok(%lnumbers,%num [ $+ [ %i ] ],32)
    inc %i
  }
  %chan = $readini($mircdir\lotto.ini, lotto, chan)
  msg $chan Your lucky numbers are:4 %num1 %num2 %num3 %num4 %num5 %num6 $+($chr(40),%num7,$chr(41))

msg $chan $sorttok($deltok(%lnumbers,7,32),32,n) $+($chr(40),%num7,$chr(41))
^ this says the first 6 numbers in order of my code and then the 7th number

and you can replace

  %num1 = $readini($mircdir\lotto.ini, lotto, lucky)
  :tryagainA
  %num2 = $rand(1,49)
  if %num2 = %num1 { /goto tryagainA }
  :tryagainB
  %num3 = $rand(1,49)
  if %num3 = %num2 || %num3 = %num1 { /goto tryagainB }
  :tryagainC
  %num4 = $rand(1,49)
  if %num4 = %num3 || %num4 = %num2 || %num4 = %num1 { /goto tryagainC }
  :tryagainD
  %num5 = $rand(1,49)
  if %num5 = %num4 || %num5 = %num3 || %num5 = %num2 || %num5 = %num1 { /goto tryagainD }
  :tryagainE
  %num6 = $rand(1,49)
  if %num6 = %num5 || %num6 = %num4 || %num6 = %num3 || %num6 = %num2 || %num6 = %num1 { /goto tryagainE }
  :tryagainF
  %num7 = $rand(1,49)
  if %num7 = %num6 || %num7 = %num5 || %num7 = %num4 || %num7 = %num3 || %num7 = %num2 || %num7 = %num1 { /goto tryagainF }
  %chan = $readini($mircdir\lotto.ini, lotto, chan)
  msg %chan Your lucky numbers are:4 %num1 %num2 %num3 %num4 %num5 %num6 ( $+ %num7 $+ )

with

  var %i = 2, %num1 = $readini($mircdir\lotto.ini, lotto, lucky), %lnumbers = %num1
  while (%i <= 7) {
    var %num [ $+ [ %i ] ] $r(1,49)
    while ($istok(%lnumbers,%num [ $+ [ %i ] ],44)) {
      %num [ $+ [ %i ] ] = $r(1,49)
    }
    %lnumbers = $addtok(%lnumbers,%num [ $+ [ %i ] ],32)
    inc %i
  }
  msg $chan Your lucky numbers are:4 %num1 %num2 %num3 %num4 %num5 %num6 $+($chr(40),%num7,$chr(41))
$sorttok($deltok(%lnumbers,7,32),32,n) $+($chr(40),%num7,$chr(41))

They are shorter, it also uses local variables instead of global, although i think its about the same efficiency.

anyway another note is u dont need to write %chan to an ini file you can just set it

  writeini $mircdir\lotto.ini lotto chan $chan 

can be:

  set %chan $chan 

and hen you can remove any of these since its already set:

  %chan = $readini($mircdir\lotto.ini, lotto, chan) 
 Respond  
frishy commented on a Page, Hello world C++  -  Jan 09, 2009

just a few tips :) :
using namespace means you're including std (since u stated std) to be used.
you can also do:

using std::cout;

if you're just using cout, which wud be more efficient if you're not using alot of std comands.

Also adding \n (when its in quotes will mean if you cout another message it well be on a new line). There is a different way but i prefer this so it would look like this:
cout << "Hello world! \n";

Keep up the good work :)

 Respond  
frishy commented on a Page, !define (slang)  -  Jan 08, 2009

yeah ignore this script it doesnt work anymore which i dont get coz it used to work but it stopped working randomly ;s

*code has been updated below to actually work but there may be a few kinks

 Respond  
frishy commented on a Page, Align Script  -  Jan 08, 2009

o right thanks :$, i still say it shud be spelt allign :P

 Respond  
frishy commented on a Page, Align Script  -  Dec 19, 2008

oh right yeah forgot to delete that lol ;x dont see why u cudnt see it though, it shows up pink not black ;s. Anyway changed it to msg $active, i still prefer say myself ;p.

 Respond  
frishy commented on a Page, Align Script  -  Dec 19, 2008

thanks man :).

why replace it, say does exactly the same as msg $active doesnt it ;x

 Respond  
frishy created a Page  -  Dec 19, 2008
605 

A script that aligns your text to right or centre. I got bored and made this ;s. It goes into ur remotes ofc (alt+r).

frishy commented on a Page, Mode bitch  -  Oct 24, 2008

do note that $replacex($1-,+,-,-,+) and $+($iif($left($1,1) == -,+,-),$right($1,-1)) can be abused

$replacex($1-,+,-,-,+)
frish sets mode +m-m
script sets mode -m+m

$+($iif($left($1,1) == -,+,-),$right($1,-1))
frish sets mode +m-m+m
script sets mode -m-m+m

just saying

 Respond  
frishy commented on a Page, !poll / !vote script  -  Jul 01, 2008

rofl. im gonna presume ur joking.

i only came back today just to look how thing changed, im not gonna reinstall mirc and spend my time on finding out why ur script doesnt work.

if you have other scripts in your remotes that possibly could affect it, but seriously i cannot help any further, my mirc scripting days are well over.

you have 3 options

1 try putting the code in a blank remotes section to see if it works then

2 adjust the code to see if you can fix it for your mirc

3 give up on the snippet

Another possibility is that they updated mirc in which my script no longer works. IDK why that would happen if it did (probably not, who knows) but this is the only help i can give ;p, i mean the code is too complex for me to be revising over (and im lazy ;p)

 Respond  
frishy commented on a Page, !poll / !vote script  -  Jul 01, 2008

on :text::#:{
if ($1 == !poll) {
...
set -e %pollchannel #
...
}

alias resultpollcode {
...
msg %pollchannel 12{{<<< Results: %pollresults 12>>>}}
...

so by seeing this it msgs the channel the result. since its not working for you i would probably say you are talking to a bot using this script not in a channel. if you did this in a channel and not chat then im sorry but i cant help since its been like a year since i quit.

 Respond  
frishy commented on a Page, !poll / !vote script  -  Jul 01, 2008

my old email doesnt work so made a new account since forgot password lol and i dont go on mirc anymore.

$addtok has a format of:
$addtok(TextToAddTo,TextBeingAdded,Position,AsciiChar)
In the script above, it looks like there is only:
$addtok(TextToAddTo,TextBeingAdded,Position)
try:
Quote:
$addtok(%pollresults,[ $+ $gettok(%voteoptions,%toknum,9) $+ $gettok(%nforoptions,%toknum,44) ],0,32)

from what i remember (may be wrong) the last parameter is optional so if you leave the last one out then there is a null being added between each token so combines the strings.

Anyway the script was fine when i used to use it and im sure it didnt have any errors.

eugenio did u type !poll when u had the script yourself, if so then thats ur problem this script is used for a bot but can easily be changed to on input.

RESULTPOLLCODE Unknown command

erm and what is the point in /pollcode or w/e it is ?!?

/resultpollcode is a subroutine because im lazy and no point since i quit mirc ;p i can only assube that its an alias to neaten the coding, to save code repetition (possibly coz mine used to have an on input too)

 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.