Back Reply to topic
Akhara 
(started thread)
Blue-Ribbon Chicken 
Topics: 1
Posts: 1
Playing:  AoC
Ingame:  Akhara
Years registered: * * * * * * * * * * *
Release:: StaticWindow Posted: Post 12:52 Tue - Jul 08, 2008

This plugin was created to update the bot fast with new content like guides, overviews or even char descriptions.

If you create a example.txt in staticwindow directory and it contains the line: "This is an example!" you can simply use the !example command and bot will answer with that line.

More interesting is the possibility to write a chat link in this .txt file (like the guild advertising scripts). I created a chat link containing the bot commands with http://jeppo.de/age_of_conan/aoc_link_editor.html then i saved the chat link in a help.txt, placed it in the staticwindow plugin and thats all. now my bot knows the !help command. Other guldmates are using it for description of their chars like backgroundstory, crafting and so on.

Attention: if you create for example a main.txt the !main command will do both functions.



Code:
<?php

/* This addon will add static info windows or static text, the links are stored in .txt files in plugin directory, if you have an example.txt he will reply on !example with the text from the file, but only till first line break
tool to create static links: http://jeppo.de/age_of_conan/aoc_link_editor.html
*/


/* commando? */
if (substr($pluginwords[1],0,1)=='!')
{
   /* that would be filename */
   $temp=$plugindirname. 'staticwindow/' . substr($pluginwords[1],1) . '.txt';

   /* does this file exist? */
   if (file_exists($temp))
   {
      $filearray=file($temp);

      /* only first line, and trim it */
      send_reply(trim($filearray[0]));
   }
}


?>


you could also substitute

Code:
$temp=$plugindirname. 'staticwindow/' . substr($pluginwords[1],1) . '.txt';


with

Code:
$temp='http://www.my-website.com/Botscripts/' . substr($pluginwords[1],1) . '.txt';


and let your members upload text files themself. But this could be dangerous if the messages are to long, or broken.

sticked, Chaly
Reply with quote


Gumble 
Blue-Ribbon Chicken 
Topics: 4
Posts: 9
 
 
Years registered: * * * * * * * * * * *
Posted: Post 05:12 Wed - Aug 13, 2008

Working pretty cool lachen

Im at work atm, will try to finish something and if work will add it for al use
Reply with quote


Mika 
Champion Chicken 
Topics: 6
Posts: 67
Location: Finland
Playing:  AOC
Ingame:  Phaestyriade
Years registered: * * * * * * * * * *
Posted: Post 10:02 Mon - Oct 20, 2008

How to make this work?


-Note


Make ./plugins/staticwindow
Copy that txt to file named index.php
Make txt files like lookme.txt
in game /tell yourbot !lookme
and voila u get txt
Reply with quote


Sabcoll 
Blue-Ribbon Chicken 
Topics: 0
Posts: 12
Playing:  Age of Conan
Ingame:  Aurelia
Years registered: * * * * * * * * * *
Posted: Post 09:42 Wed - Mar 11, 2009

This doesnt work for me.
Do i have to edit the index.php?
Reply with quote


Chaly 
Offizier · Webmaster 
Topics: 403
Posts: 2106
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * *
Posted: Post 12:48 Wed - Mar 11, 2009

hum, where did you put the script, sab? Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Sabcoll 
Blue-Ribbon Chicken 
Topics: 0
Posts: 12
Playing:  Age of Conan
Ingame:  Aurelia
Years registered: * * * * * * * * * *
Posted: Post 05:15 Wed - Mar 11, 2009

i made a new folder: mybot/plugins/staticwindow/
so my index.php for the script lies in mybot/plugins/staticwindow/index.php

just like Mida described it.

Then i put several scripts into my mybot/plugins/staticwindow/ folder.. but my Bot does no nothing!
thanks for the quick answers!
Reply with quote


Chaly 
Offizier · Webmaster 
Topics: 403
Posts: 2106
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * *
Re: Release:: StaticWindow Posted: Post 06:08 Wed - Mar 11, 2009

Akhara wrote:
Code:
$temp=$plugindirname. 'staticwindow/' . substr($pluginwords[1],1) . '.txt';

this is a bit tricky. $plugindirname is a variable inside the code. it points to the directory where the plugin has been put in. anyway..:

you should put the staticwindow plugin into this directory: plugins/tell/staticwindow
without changing the code you can put your txt-files in the same directory and it should work.


note: a plugin has always to be in a 'section'. put a plugin into plugins/guild and the bot will only execute it when you talk in the guildchannel. same to tell messages: put a plugin into plugins/tell and the plugin will 'hear' you, if you /tell the bot
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Sabcoll 
Blue-Ribbon Chicken 
Topics: 0
Posts: 12
Playing:  Age of Conan
Ingame:  Aurelia
Years registered: * * * * * * * * * *
Posted: Post 06:34 Wed - Mar 11, 2009

Alright, that makes things much clearer ...
thanks
Reply with quote


lukan 
Blue-Ribbon Chicken 
Topics: 0
Posts: 4
Playing:  AoC
Ingame:  Mushroom
Years registered: * * * * * * * * *
Posted: Post 03:03 Fri - Oct 02, 2009

this script is a beauty, was looking exactly for that...

now another question is....

how can i a make the bot post the .txt file in the global chat?
Reply with quote


Kerv 
Blue-Ribbon Chicken 
Topics: 0
Posts: 8
Playing:  Fury
Ingame:  Kervo
Years registered: * * * * * * * * *
Posted: Post 07:49 Sat - Oct 03, 2009

global chat has a strong limitation on size of the message. You can essentially only post a link with "click here for info", not more. It will simply ignore the post when you exceed the allowed number of characters.

use this to post the string $msg

send_public_channel_message( "~Global", $msg);
Reply with quote


Back Reply to topic