Bots and Forum Script: This way to the Future™!

Started by Legend, Jan 05, 2016, 05:07 AM

0 Members and 1 Guest are viewing this topic.

Legend

Quote from: the-Pi-guy on Jan 09, 2016, 04:57 AMI'd like to know what the commands for
-editing a post
-replacing text in a string, or give me a for loop and if and charAt statement.  

Editing a post is... editPost().

For non forum related things, php functions work. Use str_replace($orig, $new, $post)

the-pi-guy

Quote from: Legend on Jan 09, 2016, 05:16 AMEditing a post is... editPost().

For non forum related things, php functions work. Use str_replace($orig, $new, $post)
Sweet that's what I did!-ish.
$message=$trigger['Message'];
str_replace ( 'catman' , 'notcat' , $message);
editPost(message);
How does it look?
I'm gonna fix it up a little later.  

Legend

Quote from: the-Pi-guy on Jan 09, 2016, 05:23 AMSweet that's what I did!-ish.
$message=$trigger['Message'];
str_replace ( 'catman' , 'notcat' , $message);
editPost(message);
How does it look?
I'm gonna fix it up a little later.  

It needs to be $message=str_replace('catman', 'notcat', $message);

In php, it's rare for functions to modify source variables directly.

the-pi-guy

Quote from: Legend on Jan 09, 2016, 05:48 AMIt needs to be $message=str_replace('catman', 'notcat', $message);
In php, it's rare for functions to modify source variables directly.
Thanks!  Gotcha!

I made a memebot.  :)
Hope it's acceptable.  

Legend

Quote from: the-Pi-guy on Jan 09, 2016, 06:08 AMThanks!  Gotcha!

I made a memebot.  :)
Hope it's acceptable.  
Compiler 1.0 is really bad at nesting things inside of things, so I went through and modified your code a bit to get around that. Really need to remake the compiler haha.

Besides that, I think you're good. Won't know for sure until you make a few test posts.

the-pi-guy

#20
Quote from: Legend on Jan 09, 2016, 06:33 AMCompiler 1.0 is really bad at nesting things inside of things, so I went through and modified your code a bit to get around that. Really need to remake the compiler haha.

Besides that, I think you're good. Won't know for sure until you make a few test posts.
Thanks!!! :D

the-pi-guy

Quote from: Legend on Jan 09, 2016, 06:33 AMCompiler 1.0 is really bad at nesting things inside of things, so I went through and modified your code a bit to get around that. Really need to remake the compiler haha.

Besides that, I think you're good. Won't know for sure until you make a few test posts.
Something seems to be weird about it. 
Not working, changing my ' to some numbers. 

Legend

Quote from: the-Pi-guy on Jan 09, 2016, 10:13 PMSomething seems to be weird about it.  
Not working, changing my
' to some numbers.  
I think I fixed that. Try posting again.

the-pi-guy


Legend


Legend

Zero freaking clue why it isn't working.

I've isolated it down to the single function 'html_entity_decode' yet can still not get rid of the characters.

the-pi-guy

Quote from: Legend on Jan 10, 2016, 01:03 AMZero freaking clue why it isn't working.

I've isolated it down to the single function 'html_entity_decode' yet can still not get rid of the characters.
I'd like to mess around with stuff.  :)

Legend

Quote from: the-Pi-guy on Jan 10, 2016, 01:17 AMI'd like to mess around with stuff.  :)
No clue how to let you have access to the problem, without just throwing everything and the kitchen sink in your face.



I isolated it down to the transfer between poster and bot. The message body isn't being preserved correctly. In a few hours I'll program a custom script to fix it.

the-pi-guy

Quote from: Legend on Jan 10, 2016, 01:23 AMNo clue how to let you have access to the problem, without just throwing everything and the kitchen sink in your face.
I isolated it down to the transfer between poster and bot. The message body isn't being preserved correctly. In a few hours I'll program a custom script to fix it.
That's what I figured.  :)

Legend

Odd cookie to crack. The forum converts all messages to utf before sending them to the database, yet the database handles conversion going the opposite direction.

$trigger data bypasses the database so I needed to recode it manually. Should be good, or at least almost good. Got every special character on my keyboard working.