I want to know if I were to say "a" it would make it "b"
Like for instance if I were to say -a then made it display to myself it would show b
This was my attempt
function StringConv takes string s returns string
if s=="a"then
return "b"
endif
return s
endfunction
if SubString(s,0,2)=="-a"then
call DisplayTextToPlayer(p,0,0,StringConv(s))
Changing String
Moderator: Cheaters
-
- Legendary Genius
- Posts: 1311
- Joined: August 8th, 2007, 8:10 am
- Title: Legendary Genius²
- Location: St. George Utah
Changing String
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
-
- Legendary Genius
- Posts: 1311
- Joined: August 8th, 2007, 8:10 am
- Title: Legendary Genius²
- Location: St. George Utah
Re: Changing String
But I don't want it just for 1,2 I want it to do it wherever I say it... =/
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
-
- Honorary wc3edit.net Traitor
- Posts: 2507
- Joined: February 1st, 2007, 4:11 pm
- Location: NEVADA
Re: Changing String
then do multiple comparisons.
if x = s,1,2 , else if x = s,2,3, else... it wont work in the whole thing
if x = s,1,2 , else if x = s,2,3, else... it wont work in the whole thing
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
Re: Changing String
So something like this?
function StringConv takes string s returns string
local integer i=0
local string ss=""
local integer is=StringLength(s)
loop
exitwhen i>is
if SubString(s,i,i+1)=="a"then
set ss=ss+:b"
else
set ss=ss+"-"
endif
set i=i+1
endloop
return ss
endfunction
Then just make a trigger that registers "" and then it will detect any msg and if the msg contains any a's in it it will display a msg to you with the b for example if somewere were to say "hey what up" it would display "------b----" of cource if they said something like "hello" you would just get "-----"
function StringConv takes string s returns string
local integer i=0
local string ss=""
local integer is=StringLength(s)
loop
exitwhen i>is
if SubString(s,i,i+1)=="a"then
set ss=ss+:b"
else
set ss=ss+"-"
endif
set i=i+1
endloop
return ss
endfunction
Then just make a trigger that registers "" and then it will detect any msg and if the msg contains any a's in it it will display a msg to you with the b for example if somewere were to say "hey what up" it would display "------b----" of cource if they said something like "hello" you would just get "-----"
-
- Legendary Genius
- Posts: 1311
- Joined: August 8th, 2007, 8:10 am
- Title: Legendary Genius²
- Location: St. George Utah
Re: Changing String
I still want it to show all the string though... like if I said abc it would display bbc... you know... =/
Otherwise this isn't going to work at all for what I have planned...
Otherwise this isn't going to work at all for what I have planned...
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
Re: Changing String
...
function StringConv takes string s returns string
local integer i=0
local string ss=""
local integer is=StringLength(s)
loop
exitwhen i>is
if SubString(s,i,i+1)=="a"then
set ss=ss+"b"
else
set ss=ss+SubString(s,i,i+1)
endif
set i=i+1
endloop
return ss
endfunction
function StringConv takes string s returns string
local integer i=0
local string ss=""
local integer is=StringLength(s)
loop
exitwhen i>is
if SubString(s,i,i+1)=="a"then
set ss=ss+"b"
else
set ss=ss+SubString(s,i,i+1)
endif
set i=i+1
endloop
return ss
endfunction
-
- Legendary Genius
- Posts: 1311
- Joined: August 8th, 2007, 8:10 am
- Title: Legendary Genius²
- Location: St. George Utah
Re: Changing String
Not sure what the ... was for, but thanks it works great...
Though if you care what I am going to use it for... Multi-colors on my say command...
Though if you care what I am going to use it for... Multi-colors on my say command...

Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
Re: Changing String
My ... represented my silence in the fact that you couldn't figure out hwo to change the - into the orginal chat. ;/
*scolds jj*
*scolds jj*

-
- Legendary Genius
- Posts: 1311
- Joined: August 8th, 2007, 8:10 am
- Title: Legendary Genius²
- Location: St. George Utah
Re: Changing String
Oh... I just didn't want to do any thinking 

Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate