Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-03-2006, 11:47 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Dictionary

Dictionary
Heres my functions , while playing with this script you'll find many funny definitions. LOL
Quote:
Requesting Definition of boobies:
- small tropical gannet having a bright bill or bright feet or both
- an ignorant or foolish person
PHP Code:
function Define(word) {
 
temp.link "http://www.onelook.com/?w=" word "&ls=a";
 echo(
"Requesting Definition of" SPC word ":");
 
temp.req requesturl(temp.link);
 
this.catchevent(temp.req,"onReceiveData","onDefine");
}
function 
onDefine(obj) {
 
temp.toks obj.fulldata.tokenize("\n");
 for(
btemp.toks) {
  if (
== "<LI>") continue;
  if (
b.starts("<LI>") > 0) {
   
temp.ntoks b.tokenize(";");
   
temp.npos temp.ntoks[2].pos("(");
   
temp.defin temp.ntoks[2].substring(0,temp.npos);
   if (
temp.defin.length() > 1) echo(" - " temp.defin);
   
temp.msg++;
  }
 }
 if (
temp.msg == 0) echo("No Definitions Found!");

__________________
Quote:
Reply With Quote
  #2  
Old 10-03-2006, 11:59 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Haha, that's a pretty cool idea lol

P.S. Repped.. and I think you get like 5 rep points from me too
Reply With Quote
  #3  
Old 10-04-2006, 08:18 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Great Idea +1 Rep
__________________
Reply With Quote
  #4  
Old 10-04-2006, 09:46 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Why would graal need this?
Reply With Quote
  #5  
Old 10-04-2006, 01:10 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Twinny View Post
Why would graal need this?
Because some people don't know words =o?
Reply With Quote
  #6  
Old 10-04-2006, 02:46 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Haha, a script that made me laugh.. originall and a hillarious, yet usefull idea. Heres your rep!
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #7  
Old 10-04-2006, 07:55 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Funny! Rep++;
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #8  
Old 10-05-2006, 12:20 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Twinny View Post
Why would graal need this?
Its a good tool for when your on RC and you would like to find the definition of a word without having to open a web browser and such. I'm sure there are many more other reasons why it would be good to have too.
Reply With Quote
  #9  
Old 10-05-2006, 02:03 AM
smirt362 smirt362 is offline
Tee Hee
smirt362's Avatar
Join Date: Feb 2005
Location: Texas
Posts: 2,101
smirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant future
Send a message via AIM to smirt362 Send a message via MSN to smirt362
Nifty!
__________________

Don Hertzfeldt <3
Reply With Quote
  #10  
Old 10-05-2006, 03:25 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Rapidwolve View Post
Its a good tool for when your on RC and you would like to find the definition of a word without having to open a web browser and such. I'm sure there are many more other reasons why it would be good to have too.
Exactly why I made it.
__________________
Quote:
Reply With Quote
  #11  
Old 10-05-2006, 12:50 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
bingo! looks funny
--> Rep time!
__________________
Reply With Quote
  #12  
Old 10-06-2006, 12:07 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
I've already given you rep before Chompy
Reply With Quote
  #13  
Old 10-06-2006, 12:55 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Rapidwolve View Post
I've already given you rep before Chompy
<3 Thanks
__________________
Reply With Quote
  #14  
Old 04-18-2007, 12:10 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Hate to revive this, but just read it and found it to be useful. But I've tried a few ways to call the function but it didn't quite work.

What's the issue? Or how should I do it? As I am obviously doing it wrong..:P
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #15  
Old 04-18-2007, 12:34 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by killerogue View Post
Hate to revive this, but just read it and found it to be useful. But I've tried a few ways to call the function but it didn't quite work.

What's the issue? Or how should I do it? As I am obviously doing it wrong..:P
Call the function serverside with a word as the parameter
for example you can make a class and have a little script in the Control-NPC:

dictionary (class):
PHP Code:
function Define(word) {
 
temp.link "http://www.onelook.com/?w=" word "&ls=a";
 echo(
"Requesting Definition of" SPC word ":");
  
temp.req requesturl(temp.link);
 
this.catchevent(temp.req,"onReceiveData","onDefine");
}
function 
onDefine(obj) {
 
temp.toks obj.fulldata.tokenize("\n");
 for(
btemp.toks) {
  if (
== "<LI>") continue;
  if (
b.starts("<LI>") > 0) {
   
temp.ntoks b.tokenize(";");
   
temp.npos temp.ntoks[2].pos("(");
   
temp.defin temp.ntoks[2].substring(0,temp.npos);
   if (
temp.defin.length() > 1) echo(" - " temp.defin);
   
temp.msg++;
  }
 }
 if (
temp.msg == 0) echo("No Definitions Found!");

Control-NPC
PHP Code:
function onCreated()
 
join("dictionary");
public function 
onRCChat() {
 if (
params[0] == "defineword") {
  
temp.word params[1];
  
Define(temp.word);
 }

can be a part of the Control-NPC script at the bottom and then..
NPC Code:
 /npcdefineword <word here>


in RC chat


I think that should work..
__________________

Last edited by Chompy; 04-18-2007 at 01:15 PM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.