PDA

View Full Version : vB-DOS turning quick reply into command prompt


zajako
10-22-2003, 10:00 PM
All right, its been a while since i released something here.
Lets hope that i dont have anymore bad experinces with releasing programs here, cause i like sharing my projects with you guys.

vB-DOS is a potentialy powerful script that integrates with the vbulletin reply system. When you make a post it checks to see if you have a command word in it. If you do it then runs the proper script for that command. You can also make commands simply post a reply with an answer, for example, if you make the command !help and you set the reply to list some other commands, and leave the command field at 0 it will simply post a reply with the answer to the command you gave.
However the powerful part of this, is you can run php scripts with commands. Included with the install file are 4 common commands, that make moderating your forums easier.

!deletethread -- when this is posted by an admin, it deletes the thread it was posted in.

!dumpthread -- when this is posted by an admin or smod, it moves the thread to the assigned dump forum

!closethread -- when this is posted by an admin or smod , it closes the thread it was posted in

!openthread -- when posted by an admin or smod, it opens a closed thread it was posted in.


This script helps me alot, and my mods appriciate it. If you use it and make custom commands, please share them here, as i have shared this program with you.

Ill post all shared commands in this post, please include a description with your command that you share.

Demo
www.tfogame.com (there is a post in the news forum about it saying tfo computer, keep to that thread for testing it please) The !help command lists some userside faq commands.

Shared Commands
Stick thread - by zajako
sticky's a thread.

INSERT INTO `comp_keywords` VALUES (null, '!stickthread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET sticky=\'1\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


UnStick thread - by zajako
unsticky's a thread.

INSERT INTO `comp_keywords` VALUES (null, '!unstickthread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET sticky=\'0\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


Hide thread - by zajako
Makes a post non visible

INSERT INTO `comp_keywords` VALUES (null, '!hidethread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET visible=\'0\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


Show thread - by zajako
makes an invisible post visible

INSERT INTO `comp_keywords` VALUES (null, '!showthread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET visible=\'1\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);

MindTrix
10-23-2003, 05:00 PM
Wowowow seems a nice idea here :) I wont personally use it because im dumb but goodluck with it anyways, im sure alot of people will find this usefull

Yay im the first to congratulate you aswell ;)

assassingod
10-23-2003, 05:07 PM
Excellent idea.

zajako
10-23-2003, 05:12 PM
thanks guys :)

some things coming with version 2

-parameters (!sendwarningpm[username])
-hiding commands
-hiding post if only command is in the post

assassingod
10-23-2003, 05:25 PM
That parameters feature sounds great!

zajako
10-23-2003, 05:54 PM
yeah im sure things lik3 !banuser[username] and tons of others will be shared, another feature coming with version 2 is a control page for it to add and edit commands, however it will be default coded for userid 1 only due to pure php being able to be parsed

Phoenix_Fighter
10-23-2003, 07:05 PM
Heh, Good Job Zaj. I'll install it a bit later. ^^

Zachery
10-23-2003, 07:41 PM
good job zaj, too bad i dont have a 2.x board to install it to or i would

zajako
10-23-2003, 07:49 PM
it should be easy to port to vb3, just find the the spot after it stores the post into the posts page, then you will need to change the insert line to match vb3's post insert databasing.

Apoco
10-23-2003, 08:02 PM
wow....truely amazing. Great Job!

Zachery
10-23-2003, 08:12 PM
wow....truely amazing. Great Job!
ill take a look into porting it then zaj

NuclioN
10-23-2003, 08:16 PM
Great :) a !help command would be nice but this has a lot of potential. Well done.

zajako
10-23-2003, 08:35 PM
thanks NuclioN

Gio Takahashi
10-23-2003, 09:27 PM
EDIT:
Nevermind I misread, as I look over it again, this looks VERY sweet I think Im going to try this out on my forums.

Infact..I will! ::installs::

zajako
10-23-2003, 09:30 PM
you dont have to register to view the news forum. You can take a look at the thread about tfo computer.

Gio Takahashi
10-23-2003, 09:32 PM
I have a friend who is very good with coding language, I think he and I will come up with additional commands for this little thing. Looks fun.

Dean C
10-23-2003, 09:39 PM
This is one of the most innovative ideas I've ever seen on vBulletin.org. Along with Logician's dynamic templates this will be one of my most happiest installs. I can see a few potential flaws whilst looking at the code. Would be nice to do command permissions via usergroup or individual users. Also i'm sure there must be some better way of storing the commands in the database other than in the $DB_site->query() format. I can't think of the top of my head but it seems like an obvious security flaw. Perhaps hashing the query would a bit more secure.

Also how about a command creator. You enter your table/tables which you wish to perform commands for the particular command. Then for each table you select you have a dropdown for UPDATE,INSERT,DELETE FROM, and so on. Then you have a selection of where clauses where it detects the fields from the table and you have a dropdown for those.

Maybe i'm getting carried away but I just love the idea of this modification :)

All the best,
- Dean

zajako
10-23-2003, 09:45 PM
cool gio, thanks.

mist thinks for your compliments, i too see great potential in this hack, however i know i dont have the time to make a command creator script. I can make a admin panel page for adding them but as for making a script that creates php, that would take more time than i have right now.

maybe in the future or if somone else wants to make it as an addon.

Gio Takahashi
10-23-2003, 10:09 PM
I'd LOVE to see that command creator script going someday, this hack is just incredible, I just tested it on my forums, it worked like a charm! Great hack!

Erwin
10-23-2003, 10:30 PM
Great idea - one of the most original ideas released here. :) Well done.

zajako
10-23-2003, 10:50 PM
thanks erwin ;)

Dan
10-23-2003, 11:01 PM
wonderful hack zajako.... you plan on updating it for vB3 when it goes rc?

zajako
10-23-2003, 11:04 PM
yep, it will be an easy update to make, seeing how this does not rely on vb2's functions, i just gotta change the queries around, thats about it.

Gio Takahashi
10-24-2003, 01:31 AM
This thing is surprisingly simple and easy to play with for such a powerful script, the installation was easy as heck, Though it does requires a lot of database work but it is very easy, I will definitely try to get more command out of this.

zajako
10-24-2003, 01:34 AM
Stick thread - by zajako
sticky's a thread.

INSERT INTO `comp_keywords` VALUES (null, '!stickthread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET sticky=\'1\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


UnStick thread - by zajako
unsticky's a thread.

INSERT INTO `comp_keywords` VALUES (null, '!unstickthread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET sticky=\'0\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


Hide thread - by zajako
Makes a post non visible

INSERT INTO `comp_keywords` VALUES (null, '!hidethread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET visible=\'0\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


Show thread - by zajako
makes an invisible post visible

INSERT INTO `comp_keywords` VALUES (null, '!showthread', 'if($bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 5){\r\n $DB_site->query("UPDATE thread SET visible=\'1\' WHERE threadid=\'$threadid\'");\r\n $goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";\r\n eval("standardredirect(\\""."Thread Stuck"."\\",\\"$goto\\");");\r\n}else{\r\n $dosmess="You do not have permission to do said command.";\r\n}', 1);


4 new commands ;)

Gio Takahashi
10-24-2003, 01:52 AM
Added and tested and it works without problem.

I see a LOT of potential in this, anyone can easily make add Ons to this hack, I can also that this can go well with several other major hacks like Lesane's store hack, this one should have its own sub forums. There could be a lot of add ons involved with this one.

KingdomHeartsII
10-24-2003, 02:06 AM
This hack might make a really really really good idae, im installing Store right now, but this is on my list! nice idea!

* KingdomHeartsII LIKES! :D

zajako
10-24-2003, 02:38 AM
thanks kingdom hearts :)

Areku
10-24-2003, 07:46 AM
Isn't it faster with the small checkboxes some of you created as addon for the quick reply?

To me it's faster to click a checkbox than to write a command...

zajako
10-24-2003, 08:49 AM
this is so versitle though that you can make commands do almost anything. Not just things that the checkboxes could do. The post and thread editing commands are just some defaults i added.

Ihsahn
10-24-2003, 11:06 AM
OMG ... that's an awesome idea zajako ... a very clever one ... congratz !!

NuclioN
10-24-2003, 01:12 PM
--edit--

How does the !help command in your forum work and the !gold Zajako? I mean if i see how 1 command works i can make a lot of faq commands.

zajako
10-24-2003, 07:57 PM
!help and !gold simply have !help as the command then the reply being the responce. Just make sure the command field is set to 0 and it replys back with the message.

MrNase
10-24-2003, 08:52 PM
very nice :)

please port that to vB3 :)

NuclioN
10-24-2003, 09:29 PM
!help and !gold simply have !help as the command then the reply being the responce. Just make sure the command field is set to 0 and it replys back with the message.

Forgive me but i don't understand this. Can you give an example of such a querie as in !help?

Gio Takahashi
10-24-2003, 09:35 PM
here is what I used, it is actually very simple ,if you have Phpmyadmin do this -

In Keyword put in !help

In Reply, put in whatever you want the bot to say, thats it, the reply box is designed for what the bot should say and search and runs any script in the reply box, and make sure you set command to 0 it should be below the box. If that doesn't help, I'll show you the attachment on how I did it. Its very easy.

zajako
10-24-2003, 11:03 PM
INSERT INTO `comp_keywords` VALUES (null, '!help', 'Use the keywords to the right of the questions, to recive answers to them.\r\nobtaining gold > !gold<br>\r\nim new where do i post > !imnew<br>\r\nwhat is the gold for > !gold<br>\r\nhow do i make a character > !character<br>\r\n', 0);


an example query :)

NuclioN
10-24-2003, 11:24 PM
Tnx :) I think this will help me a lot.

Koutaru
10-24-2003, 11:51 PM
Great hack :) I'm probably going to make it turn on/off in the admin cp instead of the php file when i install this hack.

zajako
10-25-2003, 12:39 AM
cool. you should share that with the users in this thread, ill link to your file in the first post if you do.

Logik
10-26-2003, 08:34 PM
Great idea. I wont use it because it doesnt benefit me yet. but im sure i may install it in the future.:)

Gio Takahashi
10-26-2003, 10:50 PM
I find it very beneficial, It helps out on moving mutlti threads and such.

Oh, Zaj, you may want to look into that thing about the bot, when it posts, the post don't count toward the post counts, and it ends up glitching the forum post, I have to update the counter more often to fix it.

Logikos
10-27-2003, 12:01 PM
How hard would it be to add the super close command?

Gio Takahashi
10-27-2003, 12:07 PM
Its probably easy, I don't know it myself and what do you mean by super close command?

Logikos
10-27-2003, 12:34 PM
This hack Here
https://vborg.vbsupport.ru/showthread.php?t=42885&highlight=super+close

When a Admin closes a Thread, Mods or Sen Mods cannot post in them.

Gio Takahashi
10-27-2003, 05:46 PM
I like that hack.

Pretty much you program the bot by installing query commands, if you can find out the mysql query for super close a specific thread I am sure you can do that command.

zajako
10-27-2003, 09:28 PM
just make the reply be $action="sopenclosethread";
thats what i gathered by reading that hack.

Logikos
10-28-2003, 04:00 AM
I'm not following :(

zajako
10-30-2003, 12:35 AM
for the reply use what i said above
then set command = 1

alkatraz
10-30-2003, 12:46 AM
very cool hack zajako!

NuclioN
11-02-2003, 09:03 AM
I've made a second entry in the db (comp_keywords2) to give functions to another dos bot. The first one is for post/reply functions and other forum specific questions.

The second bot is made for future functions to give detailed info about members, for example if you type !zajako it will display info about him extracted out of the user entry or post in mysql or a custom infoblock with details about energy, strenght, endurance if this will be used in RPG type of situations. The problem is...how to code this. :D

mx3
11-02-2003, 04:07 PM
Great hack but it doesn't seem to work for me :-/ I'll keep trying though

EDIT: Working fine now. ^_^

zajako
11-09-2003, 05:57 PM
I've made a second entry in the db (comp_keywords2) to give functions to another dos bot. The first one is for post/reply functions and other forum specific questions.

The second bot is made for future functions to give detailed info about members, for example if you type !zajako it will display info about him extracted out of the user entry or post in mysql or a custom infoblock with details about energy, strenght, endurance if this will be used in RPG type of situations. The problem is...how to code this. :D


it would not be too hard to make it do such things, once the system takes parameters, i have not worked on making the update due to upgrading to vbulletin 3... However once i get around to setting it up for vbulletin 3 ill update it.

zajako
11-22-2003, 06:15 PM
i have a vb3 version of this if you would like it, just contact me via aim seeing how vb.org dont sharing of it as of yet.