egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bar Total Amount Tab

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Jun 26, 2020 11:00 am    Post subject: Bar Total Amount Tab Reply with quote

Hmm not exactly sure if i can explain what my idea is , but i'll try Rolling Eyes

so this idea is for my bar script and the part i am requesting is,
when a user types !beer it will do the usual putserv privmsg stuff

but the part i need to add is everytime a user types !beer it will add to a amount of say 20 per !beer command so i need a way to make it gather all of those 20's and make a total each time, almost like a bar tab , cheers in advanced all those who help me with this hehe Laughing

(I'll try and make something like above myself and post my code Very Happy )
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Jun 26, 2020 1:13 pm    Post subject: Reply with quote

If you plan to extend this to other drinks as well, I suggest having a look at dict and have all the drinks like:
Code:

dict set drinks "beer" 20
dict set drinks "vodka" 50
dict set drinks "tea" 5

and can get it's price with something like:
Code:

[dict get $drinks $drink]

for example after you make sure it exist, for example:
Code:

if {[lsearch -nocase [dict keys $drinks] $drink] != -1} {
   puthelp "PRIVMSG $chan :Price for $drink is [dict get $drinks $drink]"
}

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Jun 26, 2020 9:17 pm    Post subject: Reply with quote

hmm i see but this is for prices i think , would this work in gathering like this

?beer thats 5

?beer thats 10

and so on

would dict work for that?

so every time a user types ?beer it will add 5 to the total amount Until the user types
?pay
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Sat Jun 27, 2020 9:23 am    Post subject: Reply with quote

I think i found what i needed to use incr

http://suninet.the-demon.de/056.htm

seems to add digits to a variable, exactly what i need hehe

i'll go try it and if it works i'll post my code Rolling Eyes
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Jun 27, 2020 12:36 pm    Post subject: Reply with quote

ComputerTech wrote:

...
i'll go try it and if it works i'll post my code


And if it doesn't work, post your code if you want. You might get some help and/or ideas. Wink
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber