BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6 support => Topic started by: squattinbull on February 20, 2010, 08:19:36 pm

Title: Scripts to Module?
Post by: squattinbull on February 20, 2010, 08:19:36 pm
Hello everyone,

I was wondering if any of you would know how or could do a simple explain on how to make a script into a module?


An example script for AOC would be:



[edit by Khalem]
Code moved to attachment
Title: Re: Scripts to Module?
Post by: Drizzurdeen on February 20, 2010, 10:18:58 pm
hehe this is the script wich was written by a member of our gild ;)

just install the scripts mod of the bot and copy the script as .txt in the scripts folder of the bot ... than just type !scripts gems

works perfekt by our guildbot

greez drizz
Title: Re: Scripts to Module?
Post by: Lucalus on February 22, 2010, 03:38:34 pm
Ummm... sounds nice!
But where can i find "the scripts mod"?  ;)

greets
Title: Re: Scripts to Module?
Post by: Drizzurdeen on February 22, 2010, 09:34:40 pm
here the file ... just unpack in ur botfolder ... edit the script.lst with ur botname ... restart the bot

commands:
!scripts

the scripts we use are in the folder ... like gems and recs 

have fun
Title: Re: Scripts to Module?
Post by: Drizzurdeen on February 22, 2010, 09:36:47 pm
sry forgot the script.php ;) ... here it is
Title: Re: Scripts to Module?
Post by: Yite on February 23, 2010, 12:21:13 pm
Nice stuff, should really have it's own topic in the custom modules as I'm sure some bot admins will use it (I will  :D)
Title: Re: Scripts to Module?
Post by: Kyr on March 04, 2010, 08:00:00 am
Hey!

I downloaded your rar file of scripts and found that the recs.txt script needed a little fixin to make it work better with the scripts module.

I think it looks more like the original creator intended it to look this way.

I hope you like it!

~Kyr
Title: Re: Scripts to Module?
Post by: Drizzurdeen on March 04, 2010, 07:08:52 pm
hey ... nice work ... works perfekt ;) and yes this is exactly what the writer was ment with this script ;)

btw. would be nice if u could rerwrite another script ;) ... it's a gem-script by the same author

[edit by Khalem]
Code moved to attachment
Title: Re: Scripts to Module?
Post by: Kyr on March 08, 2010, 01:24:37 am
I did the conversion but haven't had time to finish testing it yet.  Should post soon.

~Kyr
Title: Re: Scripts to Module?
Post by: Kyr on March 08, 2010, 12:27:46 pm
Here is a slight update to the recs one as well as the completed gems one.

~Kyr
Title: Re: Scripts to Module?
Post by: Drizzurdeen on March 08, 2010, 05:57:01 pm
perfekt work ... thanks at all
Title: Re: Scripts to Module?
Post by: Kyr on March 09, 2010, 12:11:30 am
Fixed a couple bugs and changed the name of recs to recipes.  I changed my scripts module to show the name of the script you are about to open and recs wasn't meaningful enough for my users (scripts.phps included here too).
Title: Re: Scripts to Module?
Post by: Kyr on March 09, 2010, 03:06:03 am
Here is another cool script for raiding guilds.  Only shows Tier 1 and Tier 2.

add this to your scripts.lst
Code: [Select]
<a href='chatcmd:///tell <botname> <pre>script epic_raid_drops'>Epic Raid Drops</a> - <a href='chatcmd:///gu <pre>script epic_raid_drops'>show guild</a><br /><br />
Title: Re: Scripts to Module?
Post by: Kyr on March 18, 2010, 07:43:36 pm
Here is a new version of the scripts module that allows for the use of special fonts and colors in links as well as text before and after the link.
Your old script files will continue working without any modification.

I have included a sample version 2 for you to review.

add this line to your scripts.lst file for easy clicking
Code: [Select]
<a href='chatcmd:///tell <botname> <pre>script epic_raid_drops'>Epic Raid Drops</a> - <a href='chatcmd:///gu <pre>script epic_raid_drops'>show guild</a><br>
Here is how to create version 2 script files. 
script must start exactly with the text:
//-- script ver 2 --//
If the script file doesn't start with that the module will read it as the old format and that won't work.
 
Lines can start with these tags (always 8 characters):
BEFOREH-
HLINK---
AFTERH--
SPECIAL-
BODY----

The special tag is for adding text to the a tag that isn't the href i.e. <a href='blah' SPECIAL->click here</a>

The only thing I need that for so far is:
style='text-decoration:none'  (this allows non-default color and font to be used on links)

There can only be one of each.  The order of the tags is not significant, but I suggest the body tag always come last.
Title: Re: Scripts to Module?
Post by: Drizzurdeen on March 18, 2010, 09:04:37 pm
nice nice .... works fine ;) ... nice work
Title: Re: Scripts to Module?
Post by: squattinbull on March 30, 2010, 05:33:26 pm
Thank you all.  :)  You've all helped out so greatly. 

I still wish I could learn how to just make the scripts directly into a stand alone module.
Title: Re: Scripts to Module?
Post by: Kyr on March 30, 2010, 08:26:22 pm
One of the nice things about the scripts is the bot doesn't have to be restarted when you add new or change scripts.  If each script was its own module you would need to restart every time.

If you want a script to look like it has its own command use !comalias

Code: [Select]
!comalias add gems script gems
then you can call as

Code: [Select]
!gems
~Kyr

Title: Re: Scripts to Module?
Post by: Drizzurdeen on April 19, 2010, 12:47:36 pm
if someone needs the german gems script ... here it is ;) ... just unzip it lokal ... then put the gemsd.txt into the script folder of the bot ... and put the gems-folder in the gems-folder of ur bot ... after that make the changes in ur scripts.lst an everything would be fine ...

have fun
greetz da drizz
Title: Re: Scripts to Module?
Post by: Kyr on May 08, 2010, 09:40:16 pm
I had some extraneous logging left on from my testing/debug  phase.  The only change to this new scripts.phps is that the logging was removed.

I threw in 2 new scripts.  One has info about the Rise of the Godslayer expansion and the other has the values of the rare resources in CE when making sacrifices to the alter.

Put the scripts (the 2 .txt files) in the scripts folder and rename the phps to php and put it in your custom/modules folder add this to your scripts.lst:
Code: [Select]
<a href='chatcmd:///tell <botname> <pre>script xPac'>Expansion pack info</a> - <a href='chatcmd:///gu <pre>script xPac'>show guild</a>
<a href='chatcmd:///tell <botname> <pre>script rarevalue'>Value of rares</a> - <a href='chatcmd:///gu <pre>script rarevalue'>show guild</a>

and/or say these commands to the bot:
Code: [Select]
!comalias add xPac script xPac
!comalias add rare script rarevalue

~Kyr
Title: Re: Scripts to Module?
Post by: Space on June 01, 2010, 06:37:34 pm
Good work you all...

... got all the files, put them into bebot folder as explained!!

ALL works FINE - THANX
Title: Re: Scripts to Module?
Post by: Ricky1252 on August 23, 2010, 01:00:24 am
Hey guys, I was wondering, I wanted to color the clickable link.... example
Code: [Select]
<a href='chatcmd:///tell <botname> <pre>script xPac'>Expansion pack info</a>I want to get the Expansion pack info to be maybe red and not underlined instead of the default orange underline like this
Expansion pack info
I tried everything I can think of but it just always stays the default orange underline is it hard coded perhaps?
Title: Re: Scripts to Module?
Post by: Kyr on August 23, 2010, 05:50:12 pm
you need this in the A tag: style='text-decoration:none'

Like this:
<a href=" ... " style='text-decoration:none'>

That will allow you to override the default orange underlined link text.

~Kyr
Title: Re: Scripts to Module?
Post by: Ricky1252 on August 25, 2010, 12:55:18 am
awesome yeah i knew it had to be something like that im still a little knew to scripts so thanks alot kyr!
Title: Re: Scripts to Module?
Post by: dragonjr on November 19, 2010, 02:17:07 am
ok ive been told that you can make a script with out txt i tried saveing it as any file but i get nothing. right now my list has this
19.<a href='chatcmd:///tell dragonfire !script tos'>tempest of set armor</a><BR>
and in the file scripts its saved as tos.txt and when i click on it in game i get broken code on it what do i ahve to do to fix this please help me thanks
SimplePortal 2.3.7 © 2008-2024, SimplePortal