Log in

I forgot my password

Similar topics

For srbs: duelscript

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

For srbs: duelscript

Post  Chaos on Sun Jan 09, 2011 8:13 am

Hi srbs, here is that duelscript I was talking about in irc. atm it constantly echos if you are winning, loosing or tied in a duel and the score difference, I'm trying to get it to display that in the gamehud and auto-activate it during duels. Here is the origional code:

// DuelScript by Chaos
// It will constantly echo whether you are winning, loosing or tied in a duel.

newgui duel [
guititle "^f5DuelScript Manager"
guitext "Manage the settings of the DuelScript here."
guibar
guicheckbox "Show Difference" d
guibar
guitext "^f0Text to echo if winning: "
guifield ifw 20 [$ifw =; echo Text to echo if winning set to: "^f0"$ifw]
guitext "^f3Text to echo if loosing: "
guifield ifl 20 [$ifl =; echo Text to echo if loosing set to: "^f3"$ifl]
guitext "^f1Text to echo if tied: "
guifield ift 20 [$ift =; echo Text to echo if tied set to: $ift]
guibar
guitext "Interval (seconds): "
guifield delay 2 [$delay =; echo Interval between echos set to $delay seconds.]
guibar
guicheckbox "Start/Stop" go
guitab "^f5About"
guitext "Created and Developed by ^f6Chaos^f~."
]

go = 0

duel1 = [if (= $d 0) [
if (> (getfrags) (getdeaths)) [if (= $go 1) [echo "^f0"$ifw] []]
if (= (getfrags) (getdeaths)) [if (= $go 1) [echo $ift] []]
if (< (getfrags) (getdeaths)) [if (= $go 1) [echo "^f3"$ifl] []]
] []]

duel2 = [if (= $d 1) [
if (> (getfrags) (getdeaths)) [if (= $go 1) [echo "^f0"$ifw "^f1"(- (getfrags) (getdeaths))] []]
if (= (getfrags) (getdeaths)) [if (= $go 1) [echo $ift] []]
if (< (getfrags) (getdeaths)) [if (= $go 1) [echo "^f3"$ifl "^f1"(- (getdeaths) (getfrags))] []]
] []]


bind 4 [if (= $go 0) [go = 1] [go = 0]]


Last edited by srbs on Sun Jan 09, 2011 4:34 pm; edited 1 time in total (Reason for editing : removed stuff for various reasons, i have a copy of it)

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  srbs on Sun Jan 09, 2011 4:29 pm

heres version 1 lol, not automatic yet tho

note some of the improvements
- the 1st if statement
- the combined lines for incl/excl difference

gamehud = [
if $go [
if (> (getfrags) (getdeaths)) [
result (concatword "^f0 " $ifw "^f1 " (? $d (- (getfrags) (getdeaths))))
] [
if (= (getfrags) (getdeaths)) [
result $ift
] [
if (< (getfrags) (getdeaths)) [
result (concatword "^f3 " $ifl "^f1 " (? $d (- (getdeaths) (getfrags))))
]
]
]
] [
//stats line Razz
]
]

_________________

srbs
Admin

Posts: 644
Join date: 2009-11-13

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Sun Jan 09, 2011 8:45 pm

looks nice srbs Very Happy I'll try to work on it too and there are probably many more features we can add such as customizable colors which could be quite cool. So far so good! Smile

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Mon Jan 10, 2011 4:31 pm

okay i fixed up something wrong with the echos; it would put in too many spaces so i used concatword to fix. Here is all that we have so far (made it a little neater too):


// DuelScript by Chaos and srbs
// It will constantly echo whether you are winning, loosing or tied in a duel. It will also display this in the gamehud.

//GUI:

newgui duel [
guititle "^f5DuelScript Manager"
guitext "Manage the settings of the DuelScript here."
guibar
guicheckbox "Show Difference" d
guibar
guitext "^f0Text to echo if winning: "
guifield ifw 20 [$ifw =; echo Text to echo if winning set to: "^f0"$ifw]
guitext "^f3Text to echo if loosing: "
guifield ifl 20 [$ifl =; echo Text to echo if loosing set to: "^f3"$ifl]
guitext "^f1Text to echo if tied: "
guifield ift 20 [$ift =; echo Text to echo if tied set to: $ift]
guibar
guitext "Interval (seconds): "
guifield delay 2 [$delay =; echo Interval between echos set to $delay seconds.]
guibar
guicheckbox "Start/Stop" go
guitab "^f5About"
guitext "Created and Developed by ^f6Chaos^f~ and ^f6srbs^f~."
]

//Commands:

go = 0

duel1 = [if (= $d 0) [
if (> (getfrags) (getdeaths)) [if (= $go 1) [echo (concatword "^f0" $ifw)] []]
if (= (getfrags) (getdeaths)) [if (= $go 1) [echo (concatword "^f1" $ift)] []]
if (< (getfrags) (getdeaths)) [if (= $go 1) [echo (concatword "^f3" $ifl)] []]
] []]

duel2 = [if (= $d 1) [
if (> (getfrags) (getdeaths)) [if (= $go 1) [echo (concatword "^f0" $ifw "^f1 " (- (getfrags) (getdeaths)))] []]
if (= (getfrags) (getdeaths)) [if (= $go 1) [echo (concatword "^f1" $ift)] []]
if (< (getfrags) (getdeaths)) [if (= $go 1) [echo (concatword "^f3" $ifl "^f1 " (- (getdeaths) (getfrags)))] []]
] []]

//To toggle script on/off, feel free to change key or delete:

bind 4 [if (= $go 0) [go = 1] [go = 0]]

//Gamehud:

getstats = [ result (format "%1^f1Frags: ^f3%2 ^f1Deaths: ^f3%3 ^f1Acc: ^f3%4%% ^f1KpD: ^f3%5%6" (? $arg1 (format "^f1Name: ^f3%1 " (getname))) (getfrags) (getdeaths) (getaccuracy) (substr (divf (getfrags) (max (getdeaths) 1)) 0 4) (? (> (getmode) 10) (concat " ^f1Flags:^f3" (getflags)))) ]

gamehud = [
if $go [
if (> (getfrags) (getdeaths)) [
result (concatword "^f0 " $ifw "^f1 " (? $d (- (getfrags) (getdeaths))))
] [
if (= (getfrags) (getdeaths)) [
result $ift
] [
if (< (getfrags) (getdeaths)) [
result (concatword "^f3 " $ifl "^f1 " (? $d (- (getdeaths) (getfrags))))
]
]
]
] [
result (getstats 0)
]
]



Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  srbs on Mon Jan 10, 2011 5:02 pm

are you going to keep the echo part or just make it gamehud only?

_________________

srbs
Admin

Posts: 644
Join date: 2009-11-13

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Tue Jan 11, 2011 9:23 am

I'd like to give users the option to use either gamehud or echos (or both simultaneously). I'm also thinking of adding a bind that echos only once, which can be enabled/disabled aswell.

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  srbs on Tue Jan 11, 2011 12:20 pm

well, in that case, might i suggest a consolidation of code:

chaos - duel script.cfg

_________________

srbs
Admin

Posts: 644
Join date: 2009-11-13

Back to top Go down

Re: For srbs: duelscript

Post  Scoob-DooBR on Tue Jan 11, 2011 1:29 pm

i really really dont understand this
i just try to ready the scripts when Sleep
xDD

Scoob-DooBR

Posts: 133
Join date: 2010-12-21
Age: 17
Location: Brazil

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Wed Jan 12, 2011 8:29 am

Thats a lot neater than my bulky code Razz Now we just need options to toggle individual parts of the script on and off and an auto-initiation option. I think I might be able to do the first part but idk about the auto-initiation.

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  srbs on Wed Jan 12, 2011 5:00 pm

I make things as neat & short as possible. Smile

You can do the gui stuff with the settings, I can do the auto-on/off.

_________________

srbs
Admin

Posts: 644
Join date: 2009-11-13

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Wed Jan 12, 2011 6:52 pm

Ok my part is done, added a tab that allows you to disable parts of the script, here is the new code:

// DuelScript by Chaos and srbs
// It will constantly echo whether you are winning, loosing or tied in a duel. It will also display this in the gamehud.

//GUI
newgui duel [
guititle "^f2DuelScript Manager"
guitext "Manage the settings of the DuelScript here."
guibar
guicheckbox "Show Difference" d
guibar
guitext "^f0Text if winning: "
guifield ifw 20 [ echo "Text if winning set to:^f0" $ifw ]
guitext "^f3Text if loosing: "
guifield ifl 20 [ echo "Text if loosing set to:^f3" $ifl ]
guitext "^f1Text if tied: "
guifield ift 20 [ echo "Text if tied set to:" $ift ]
guibar
guicheckbox "Start/Stop" go
guitab "^f5Options"
guitext "^f2Continuous Echo: "
guilist [
guitext "Interval (seconds): "
guifield delay 2 [ echo "Interval between echos set to" $delay "seconds." ]
guibar
guicheckbox "Disable" en1
]
guibar
guilist [
guitext "^f2Single Echo: "
guicheckbox "Disable" en2
]
guibar
guilist [
guitext "^f2Duel Gamehud: "
guicheckbox "Disable" en3
]
guitab "^f5About"
guitext "Created and Developed by ^f6Chaos^f~ and ^f6srbs^f~."
]

//helper functions
getstats = [ result (format "%1^f1Frags: ^f3%2 ^f1Deaths: ^f3%3 ^f1Acc: ^f3%4%% ^f1KpD: ^f3%5%6" (? $arg1 (format "^f1Name: ^f3%1 " (getname))) (getfrags) (getdeaths) (getaccuracy) (substr (divf (getfrags) (max (getdeaths) 1)) 0 4) (? (> (getmode) 10) (concat " ^f1Flags:^f3" (getflags)))) ]
getduelstatus = [
if (> (getfrags) (getdeaths)) [
result (concatword "^f0" $ifw "^f1 " (? $d (- (getfrags) (getdeaths))))
] [
if (= (getfrags) (getdeaths)) [
result (concatword "^f1" $ift)
] [
result (concatword "^f3" $ifl "^f1 " (? $d (- (getdeaths) (getfrags))))
]
]
]

//gamehud
gamehud = [
if (= $en3 0) [
if $go [
result (getduelstatus)
] [
result (getstats 0)
]
] [
result (getstats 0)
]
]


//echo on bind
bind 5 [ if (= $en2 0) [ echo (getduelstatus) ] ]

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  srbs on Thu Jan 13, 2011 11:50 pm

Chaos: check the link!

_________________

srbs
Admin

Posts: 644
Join date: 2009-11-13

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Fri Jan 14, 2011 3:05 pm

srbs this is awesome! Thanks for all your help. 1 more thing tho (Razz) is it possible have an option to turn the auto-initiation on and off?

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  Chaos on Sat Jan 15, 2011 9:13 am

I have another idea; GUI options that allow the user to show/hide parts of the gamehud (normal one, not duel one) such as KpD, acc or timeleft, what do u think? Smile

Chaos

Posts: 33
Join date: 2010-06-06
Age: 61

Back to top Go down

Re: For srbs: duelscript

Post  srbs on Sun Jan 16, 2011 1:18 am

hmm, not a bad idea

_________________

srbs
Admin

Posts: 644
Join date: 2009-11-13

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum