Oracle chat in a dialog

By juhapuha on Aug 04, 2008

This is a chat dialog with oracle, the oracle answers your questions.
At the moment the oracle can answer only in Finnish but i will make an edit so it will be able to answer atleast in English too.
The snippet is easy to use and I don't think there's other oracle script in hawkee (yet ;d).
Just type /oraakkeli to open the dialog. The snippet will ask you to set your nick.
Then you're ready to chat :)

I wish you enjoy the script.

dialog oraakkeli {
  title "Lintukodon oraakkeli"
  size -1 -1 250 150
  option dbu
  edit "", 1, 10 10 230 120, read multi vsbar
  edit "", 2, 10 130 180 10
  button "Sano", 3, 200 130 37 9, default flat
}

on *:dialog:oraakkeli:init:*:{
  did -a oraakkeli 1 Tervetuloa oraakkeliin. Tämä on korjattu versio MSDB:ssä olevasta oraakkelista dialogissa.
  set %o.nick $input(Anna nick jolla chattailla oraakkelin kanssa.,e,Oraakkelissa käyttämäsi nimi)
}
on *:dialog:oraakkeli:sclick:*:{
  if ($did == 3 && $did(2) != $null) {
    sockopen oraakkeli lintukoto.net 80
    set %kysymys $did(2)
    did -r oraakkeli 2
    did -a oraakkeli 1 $time $+(<,%o.nick,>) %kysymys $crlf
  }
}
on *:sockopen:oraakkeli:{
  if ($sockerr > 0) did -a oraakkeli 1 Tapahtui virhe yhdistettäessä palvelimeen.
  else {
    sockwrite -n oraakkeli GET http://www.lintukoto.net/viihde/oraakkeli/index.php?html=0&kysymys= $+ $replacex(%kysymys,$chr(32),%20,$,$eval($,0))
    sockwrite -n oraakkeli Host: www.lintukoto.net
    sockwrite -n oraakkeli Connection: close
    sockwrite -n oraakkeli $crlf
  }
}
on *:sockread:oraakkeli:{
  sockread %o
  did -a oraakkeli 1 $time <Oraakkeli> %o $crlf
}
alias oraakkeli dialog -m oraakkeli oraakkeli

Comments

Sign in to comment.
juhapuha   -  Aug 04, 2008

Sorry for the Finnish language in the script. I made it for my own purposes and will post a English version of it 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.