consent with ini

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Nanan
orc pawn
orc pawn
Posts: 29
Joined: Wed Jun 25, 2003 6:21 pm

consent with ini

Post by Nanan » Mon Oct 20, 2003 11:53 pm

I have been working on this one for a while, tweaking here and there untill It was working well enough that I felt it was ready to be posted.

A small help can be shown by..
/mac consent help

You can add names by just doing a...
/mac consent name1 name2 name3 name4 ... name(n)

You can append a name to the ini by doing this...
/mac consent append name1 name2 name3 name4 ... name(n)

You can also show a list of who is on the consent list by...
/mac consent list

You can consent your current group with..
/mac consent group

And last but not least you can consent people on the ini by simply
/mac consent


Code: Select all


#define inipath "consent.ini"
#turbo
Sub Main
/zapvars
/declare rg array
/declare rog global
/declare a1 global 0
/declare c1 global 0
/declare e1 global 0
/declare g1 global 0
/varset g1 -1
|--------------------------------------------
/if $defined(Param0)==false {
    /call Consentlist
}
    /if "@Param0"=="Group" {
        /Call ConsentGroup
        /end
    }
    /if "@Param0"=="list" {
        /Call ListINI
        /end
    }
    /if "@Param0"~~"help" {
        /call Help
        /end
    }
    /if "@Param0"~~"append" {
        /goto :loop3
        /end
    }

|--------------------------------------------

/for a1 0 to 20
    /if $defined(Param$int(@a1))==false {
        /end
    }
/ini "inipath" consented $int(@a1) "@Param$int(@a1)"
/echo $int(@a1) - @Param$int(@a1), Added to consent.ini

/next a1
/return

|++++++++++++++++++++++++++++++++++++++++++++++

:loop3
/for c1 0 to 20
    /if "$ini(inipath,consented,$int(@c1))"~~"NOTFOUND" {
        /varset e1 @c1
        /goto :loop4
    }
/next c1

|++++++++++++++++++++++++++++++++++++++++++++++

:loop4
/for a1 1 to 20
    /if $defined(Param$int(@a1))==false {
        /end
    }
    /ini "inipath" consented $int(@e1) "@Param$int(@a1)"
    /echo $int(@e1) - @Param$int(@a1), Is being appended to the ini.
    /varadd e1 1
/next a1
/return

|----------------------------------------------

Sub Help
/echo If you add names by leaving params after mac call ie. /mac consent name1 name2 ...name(N).
/echo If you want to consent your group then /mac consent group.
/echo If you do not specify add params and it will consent the people in the ini.
/echo if you forgot who is on your consent list then type /mac consent list.
/return


|----------------------------------------------

Sub Consentlist
/for c1 0 to 20
    /if "$ini(inipath,consented,$int(@c1))"~~"NOTFOUND" {
        /if $int(@c1)<1 {
            /echo There is noone on your consent list. Try /mac consent help.
            /end
        } else /end
    }
    /echo Consenting $ini(inipath,consented,$int(@c1)).
/varset rog $ini(inipath,consented,$int(@c1))
/consent @rog
/delay 3s
/next c1
/return

|----------------------------------------------

Sub ConsentGroup
/declare CG local
    /if $group(count)==1 {
        /echo You do not have a group, go find one. $group(count)
        /end
    }
/for CG 1 to $group(count)
    /varset rog $spawn($group(@CG),name)
    /echo @rog
    /consent @rog
    /delay 3s
/next CG
/return

|----------------------------------------------

Sub ListINI
/echo Players on Consent.ini list.
/for c1 0 to 20
    /if "$ini(inipath,consented,$int(@c1))"~~"NOTFOUND" {
        /if $int(@c1)<1 {
            /echo There is noone on your consent list. Try /mac consent help.
            /end
        } else /end
    }
    /varset rog $ini(inipath,consented,$int(@c1))
    /echo @rog
/next c1
/return

Thanks for the ini help in irc those of you whoms names I forgot.
Last edited by Nanan on Tue Oct 21, 2003 12:25 am, edited 3 times in total.

in_training
Craptastic
Posts: 115
Joined: Fri Oct 10, 2003 8:25 am

Post by in_training » Mon Oct 20, 2003 11:55 pm

Nanan rocks!!!

Thanks for this macro!