IceChat Forums

IceChat 5 Scripting => Scripting => Topic started by: HackBenjamin on March 31, 2008, 08:34:36 AM

Title: OUTTEXT
Post by: HackBenjamin on March 31, 2008, 08:34:36 AM
Sorry for making another topic again so soon.

I am trying to get this censor script to not work in one channel, but i want it to work in every other channel.

Code: [Select]
Function OUTTEXT(OutgoingText)
if lcase(getidentifier("$currentwindow"))="#MJSChat" then
OUTTEXT = OUTTEXT
OUTTEXT = replace(OutgoingText,"heck","(O_o)")
OUTTEXT = replace(OUTTEXT,"stuff","(O_O)")
OUTTEXT = replace(OUTTEXT,"bitch","(o_O)")
OUTTEXT = replace(OUTTEXT,"ass","(0_0)")
OUTTEXT = replace(OUTTEXT,"darn","(o_o)")
OUTTEXT = replace(OUTTEXT,"brb","be right back")
OUTTEXT = replace(OUTTEXT,"nvm","nevermind")
OUTTEXT = replace(OUTTEXT,"foo","foolish person")
End Function

As soon as i added the following line(s), the whole script stopped working in all channels.

Code: [Select]
]Function OUTTEXT(OutgoingText)
if lcase(getidentifier("$currentwindow"))="#MJSChat" then
OUTTEXT = OUTTEXT
Title: Re: OUTTEXT
Post by: Snerf on March 31, 2008, 11:41:08 AM
OUTTEXT requires that you assign OUTTEXT to OutGoingText, or you can not type anything. You have done this, but at the beginning of the function, it needs to be at the end.
2nd, you only assigned the value inside the IF < > area, which means if you were not in that channel, you cant type/send anything as well, and you also forgot the "end if" as well.

Also, you should not continuely assign the OUTTEXT value, that will slow it down a great deal.
This should work a lot better for you:

Code: [Select]
Function OUTTEXT(OutgoingText)
if lcase(getidentifier("$currentwindow"))="#MJSChat" then
  OutGoingText = replace(OutgoingText,"heck","(O_o)")
  OutGoingText = replace(OutGoingText,"stuff","(O_O)")
  OutGoingText = replace(OutGoingText,"bitch","(o_O)")
  OutGoingText = replace(OutGoingText,"ass","(0_0)")
  OutGoingText = replace(OutGoingText,"darn","(o_o)")
  OutGoingText = replace(OutGoingText,"brb","be right back")
  OutGoingText = replace(OutGoingText,"nvm","nevermind")
  OutGoingText = replace(OutGoingText,"foo","foolish person")
end if
OUTTEXT = OutGoingText
End Function

Title: Re: OUTTEXT
Post by: HackBenjamin on March 31, 2008, 12:45:56 PM
Ah, i see, thanks