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

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

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Legend

I'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

Editing 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.
Code: [Select]

$message=$trigger['Message'];
str_replace ( 'catman' , 'notcat' , $message);
editPost(message);

How does it look?
I'm gonna fix it up a little later.  

Legend

Sweet that's what I did!-ish.
Code: [Select]

$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

It 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

Thanks!  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

Jan 09, 2016, 06:35 AM Last Edit: Jan 09, 2016, 06:38 AM by the-pi-guy
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.
Thanks!!! :D

the-pi-guy

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.
Something seems to be weird about it. 
Not working, changing my
Code: [Select]
'
 to some numbers. 

Legend

Something seems to be weird about it.  
Not working, changing my
Code: [Select]
'
 to some numbers.  
I think I fixed that. Try posting again.

the-pi-guy

We'll see. 
*Shrugs*

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

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.
I'd like to mess around with stuff.  :)

Legend

I'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

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.
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.

Go Up