stealthbot/StealthBot

Help - Add colors to profile with BCP script

pglandrew opened this issue · 21 comments

Hello can some one give me help with this

x = Int(bcp_Get("Main", "ProfileUpdate"))
If x >= 1 Then
If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 60) Then
bcpLastProfileUpdate = Now()
bodyOf = MyChannel & " Top Runners: " & vbCrLf
data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
bodyOf = bodyOf & data
SetBotProfile "", "[BCP " & bcp_ConcVersion() & "." & bcpVID & "] " & bcp_Get("Main", "ProfileHead"), bodyOf
bcp_DebugMsg "Profile updated."
End If
End If

i change it in:
If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 10) Then
bcpLastProfileUpdate = Now()
bodyOf = " Top 5 BaByBaaL: " & vbCrLf
data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
bodyOf = bodyOf & data
SetBotProfile "", bcp_Get("Main", "ProfileHead"), bodyOf
bcp_DebugMsg "Profile updated."
End If
End If

what i want to do is make the top and the runners with colors, also i want to change the runners like this:

From This: runner1(1000)
in This: runner1 <_ 1000>

with colors ofc

Also i need GENDER with color

Please help me!
Regards

Use
bodyOf = "ÿc1 Top 5 BaByBaaL: " & vbCrLf
Replace the "1" after the "ÿc" with the number/symbol for the color you want to use.

ÿc1 = Red
ÿc2 = Blue
ÿc3 = Green
ÿc4 = Gold
ÿc8 = Orange
ÿc- = White
ÿc: = Dark Green
ÿc0 = white
ÿc5 = grey
ÿc6 = black
ÿc7 = gold
ÿc9 = Yellow
ÿc; = Purple

Thanks for answer @Davnit but that dont work! i try already that

Basicly i need a extra code in bcp script to read from bcp_settings.ini ÿc1 ÿc2 samd
like ProfileUpdate=ÿc1Message this work in bcp_settings.ini

actualy i need some code like profileupdate to load from bcp_settings.ini

in bcp_settings.ini you got this:

ProfileUpdate=1
ProfileHead=ÿc2MESSAGE
BCPEnabled=True
ScriptLastUpdate=3/11/2018 5:29:08 AM
ScriptUpdateLoc=

if i check the bot description the LOCATION is colored with color yc2and MESSAGE

i need to add codes in bcp script, in this line if i dont wrong
SetBotProfile "", bcp_Get("Main", "ProfileHead"), bodyOf

to read colors from bcp_settings

To read a line from the bcp_settings.ini file you can use bcp_Get("section", "key")
where section is the heading it's under (example: Main) and key is the name of the setting (example: ProfileHead).

For example if you wanted to make the runners a different color than the top line you could change this line
data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
to
data = bcp_Get("Main", "RunnerColor") & Join(Split(bcp_TopX(5), ", "), vbCrLf).
Then in bcp_settings.ini you would add a line in the same section as ProfileUpdate:
RunnerColor=ÿc3


The line that starts with SetBotProfile controls what is being set to the profile... the first parameter is the sex/gender (which doesn't do anything), the second is the location, and the third is the description.


To change how the top users are formatted you'd need to find Function bcp_TopX(n)

Specifically the line
bcp_TopX = bcp_TopX & bubble(i) & " (" & bcpUsers.Item(bubble(i)).Runs & "), "
In this the part bubble(i) holds the user's name and bcpUsers.Item(bubble(i)).Runs holds their number of runs. You can replace the rest with whatever you want.

I'm still not entirely sure what you're wanting to do, so I'm just trying to give you as much relevant information as I can in the hopes that you'll figure it out.

Thanks to answer @Davnit , this is what i want to do => https://imgur.com/a/FBTVu

i try what you say but i get error like this:

06:29:02] Scripting parsing error '1010' in bcp_2_0_6.txt: (line 1282; column 81)
[06:29:02] Expected identifier
[06:29:02] Offending line: >> data = bcpGet("Main", "RunnerColor") & Join(Split(bcp_TopX(5), ", "), vbCrLf).

the screenshot what i post that i want to do with description

the colored top 5 runners.... like in screenshot

There is an underscore symbol _ needed in between "bcp" and "Get". I'm not sure why that didn't make it to my example but I updated my post now.

Also I think I understand. You'd need to refer to the last part of my post about the bcp_TopX function.

You would specifically need to change it to something like this:
bcp_TopX = bcp_TopX & "ÿc;" & bubble(i) & " <- ÿc1" & bcpUsers.Item(bubble(i)).Runs & ">, "

If you wanted those colors to be read from the settings file you'd do this:
bcp_TopX = bcp_TopX & bcp_Get("Main", "RunnerColor") & " <- " & bcp_Get("Main", "RunCountColor") & bcpUsers.Item(bubble(i)).Runs & ">, " (all one line).

Then in your settings file under [Main] You would set

RunnerColor=ÿc;
RunCountColor=ÿc1

i put the simbol but still dont work: look

x = Int(bcp_Get("Main", "ProfileUpdate"))
If x >= 1 Then
If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 10) Then
bcpLastProfileUpdate = Now()
bodyOf = " Top 5 BaByBaaL: " & vbCrLf
data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
bodyOf = bodyOf & data
SetBotProfile "BIO", bcp_Get("Main", "ProfileHead", "RunnerColor") & Join(Split(bcp_TopX(5), ", "), vbCrLf)
bcp_DebugMsg "Profile updated."
End If
End If

i set in bcp_settings.ini RunnerColor=ÿc1

and the color dont work, ofc i reload the script

can you make the code directly to put directly in script to test it? maybe i do something wrong i see what you give me but no work for me dunno what i do wrong, can you make directly the codes and let me replace in bcp script with your codes directly maybe work please?

x = Int(bcp_Get("Main", "ProfileUpdate"))
If x >= 1 Then
    If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 10) Then
        bcpLastProfileUpdate = Now()
        bodyOf = " Top 5 BaByBaaL: " & vbCrLf
        data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
        bodyOf = bodyOf & data
        SetBotProfile "BIO", bcp_Get("Main", "RunnerColor") & Join(Split(bcp_TopX(5), ", "), vbCrLf)
        bcp_DebugMsg "Profile updated."
    End If
End If

You'd then need to run this command in the bot /bcp cfg set Main RunnerColor ÿc;

This will change the color for the entire description. Also you can't change the contents of the gender field. It's only there for backwards compatibility.

I do that and still not work, maybe can you join in my pc and check what is wrong? i do exactly what you say reload setup and still not work :| lmk skype id to give info about tw

Sorry I can't do remote support.

Try using this code instead... something was missing from the previous one.

x = Int(bcp_Get("Main", "ProfileUpdate"))
If x >= 1 Then
    If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 10) Then
        bcpLastProfileUpdate = Now()
        bodyOf = " Top 5 BaByBaaL: " & vbCrLf
        data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
        bodyOf = bodyOf & data
        SetBotProfile "BIO", bcp_Get("Main", "RunnerColor") & Join(Split(bcp_TopX(5), ", "), vbCrLf), bodyOf
        bcp_DebugMsg "Profile updated."
    End If
End If

that i use , and still not work come channel Op BaByBaal to see not working @east ofc

at last working => http://prntscr.com/ipkn1g

but now Location not work anymoore, and the username disapere

Can you make it please to working Location also back, GENDER also to be writed BIO with this color => ÿc8
TOP 5 with this color ÿc8 and CHANNELNAME with this color ÿc3 and the users with this color ÿc; and make this THE <> with ÿc3 < _ COUNT RUNS > and the _ COUNT RUNS with ÿc1 please???

Oh that's my bad. I copied the wrong code. It's late. I'm tired.

Try this:

	x = Int(bcp_Get("Main", "ProfileUpdate"))
	If x >= 1 Then
		If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 60) Then
			bcpLastProfileUpdate = Now()
			bodyOf = "Top 5 BaByBaaL: " & vbCrLf
			data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
			bodyOf = bodyOf & data
			SetBotProfile "", bcp_Get("Main", "ProfileHead"), bodyOf
			bcp_DebugMsg "Profile updated."
		End If
	End If

Then for the bcp_TopX function use this:

Function bcp_TopX(n)
	bcp_TopX = ""
	bubble = bcp_RankBubble()
	If (UBound(bubble) = 0) Then Exit Function
	If UBound(bubble) < n Then
		t = UBound(bubble)
	Else
		t = n
	End If
	
        runnerColor = bcp_Get("Main", "RunnerColor")
        runCountColor = bcp_Get("Main", "RunCountColor")
	For i = 1 to t
		If bcpUsers.Exists(bubble(i)) Then
			bcp_TopX = bcp_TopX & runnerColor & bubble(i) & " <- " & runCountColor & bcpUsers.Item(bubble(i)).Runs & runnerColor & ">, "
		End If
	Next
	
	If bcp_TopX <> "" Then
		bcp_TopX = Left(bcp_TopX, Len(bcp_TopX) - 2)
	End If
End Function

I need to go to bed so if this doesn't work, I won't be able to help you further until tomorrow.

This worked => http://prntscr.com/ipkqy4

now i need to put 2 colors on TOP 5 BaByBaaL:
how can i add this?

what i mean is this:

ÿc8TOP 5 ÿc3BaByBaaL:

Just change the bodyOf = "TOP 5 BaByBaaL: " & vbCrLf line:

	x = Int(bcp_Get("Main", "ProfileUpdate"))
	If x >= 1 Then
		If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 60) Then
			bcpLastProfileUpdate = Now()
			bodyOf = "ÿc8TOP 5 ÿc3BaByBaaL: " & vbCrLf
			data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
			bodyOf = bodyOf & data
			SetBotProfile "", bcp_Get("Main", "ProfileHead"), bodyOf
			bcp_DebugMsg "Profile updated."
		End If
	End If

Hi @Davnit i do that and here you go => http://prntscr.com/iprfm7

bodyOf = "ÿc8TOP 5 ÿc3BaByBaaL: " & vbCrLf

this dont work because script can't write directly the ÿc codes
he need also to be writed from bcp_settings like runnerscolor runtcontcolor
i try to make to something but dont work bassicly need another code for this i try something but not read what i try i was to make like that

runnerColor5 = bcp_Get("Main", "RunnerColor5")
runnerColor6 = bcp_Get("Main", "RunnerColor6")

bodyOf = RunnerColor5 & "ÿc8TOP 5 ÿc3BaByBaaL: " & vbCrLf

but this dont work

Try this:

	x = Int(bcp_Get("Main", "ProfileUpdate"))
	If x >= 1 Then
		If Int(DateDiff("s", bcpLastProfileUpdate, Now())) > (x * 60) Then
			bcpLastProfileUpdate = Now()
			bodyOf = bcp_Get("Main", "Top5Color") & "TOP 5 " & bcp_Get("Main", "ChannelNameColor") & "BaByBaaL: " & vbCrLf
			data = Join(Split(bcp_TopX(5), ", "), vbCrLf)
			bodyOf = bodyOf & data
			SetBotProfile "", bcp_Get("Main", "ProfileHead"), bodyOf
			bcp_DebugMsg "Profile updated."
		End If
	End If

You'll also need to use the following commands:
/bcp cfg set Main Top5Color ÿc8
/bcp cfg set Main ChannelNameColor ÿc3

Then for the bcp_TopX function:

Function bcp_TopX(n)
	bcp_TopX = ""
	bubble = bcp_RankBubble()
	If (UBound(bubble) = 0) Then Exit Function
	If UBound(bubble) < n Then
		t = UBound(bubble)
	Else
		t = n
	End If
	
        runnerColor = bcp_Get("Main", "RunnerColor")
        runCountColor = bcp_Get("Main", "RunCountColor")
        runCountColor2 = bcp_Get("Main", "RunCountColor2")
	For i = 1 to t
		If bcpUsers.Exists(bubble(i)) Then
			bcp_TopX = bcp_TopX & runnerColor & bubble(i) & runCountColor2  & " <" & runCountColor & "- " & bcpUsers.Item(bubble(i)).Runs & runCountColor2 & ">, "
		End If
	Next
	
	If bcp_TopX <> "" Then
		bcp_TopX = Left(bcp_TopX, Len(bcp_TopX) - 2)
	End If
End Function

And the commands:
/bcp cfg set Main RunnerColor ÿc;
/bcp cfg set Main RunCountColor ÿc1
/bcp cfg set Main RunCountColor2 ÿc3

There's nothing I can do about the gender field. You can set it manually from the Bot menu -> Edit Profile. It shouldn't get touched by the script.

Work very well => http://prntscr.com/ipvn49

i try by self but i miss :D that bcp_Get("Main", "Top5Color") & "TOP 5 " & bcp_Get("Main", "ChannelNameColor") & "BaByBaaL: " & vbCrLf

ok now i need to add 2 different message repetive with delay

example: bot say first message /me Blablabla delay 1200
bot say second message /me HaHaHaHa delay 1300

how can i add this in script?

Thank you very much for helping! apreciate a lot!

also where i can find this scrips to add in:

here is link you can check: http://babybaal.forumprod.com/commands-t1.html

These are much bigger requests. You'll have to look around on our scripting forums to see if someone else has done it or something similar. If they haven't you'll have to look at existing scripts to see if you can replicate the functionality. I don't have enough free time to start writing up new scripts.

ok thanks for info, got another problem any ideea why the bot dont announce the games and also if i type .games he dont show the games but games is up... any ideea?

No idea, I've never used any of those scripts.

@Davnit got a problem http://prntscr.com/iqhr07

any ideea why he show me 2 times same user? also he dont register the users in bcp_users :|

i change the user/charachter and now he register user in bcp_user but in top 5 look like this => http://prntscr.com/iqi7ig

2 time same user

but he dont count the runs only 1 game count in rest 0 any idea?

is possibly no counts games, because the bot what i use he dont use bcp_Set "Behavior", "SaveOnExit", "True", False

he use quitGame that mean close the game

i put also in bcp_Set "Behavior", "quitGame", "True", False

but still no count games..

@edit

i check manual (LEGIT) TESTBAAL-1, TESTBAAL-2 and he count the games:

but if i close directly the game the bot dont count the games, any ideea how can i fix this?

basicly bot using SaveOnExit, to save runs with GameReturn i think

i need using quitGame, then he can register the runs on top5

Hey Davnit!

Would you might do a step guide 1-10
with ont how you do this profile thing. got it to work once and got back after a year and having a hard time getting the colors O.o

http://prntscr.com/ipvn49

thats the babybaal end reslut of 2018. id like something like that but the yc doesnt show as color :S