ini consent mac

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

confused

ini consent mac

Post by confused » Fri Oct 17, 2003 2:13 am

If I am not totally off this chunk of code should read the param's entered and write them to the ini file. Yet it does not. The echo line in there returns a number - name. So the vars are loading the name and number right I think.

Code: Select all

#define inipath "c:\my documents\consent.ini"
Sub Main
/zapvars
/declare rg array
/declare a1 global
/declare b1 global
/varset a1 -1
:loop
/varadd a1 1
/if $defined(Param$int(@a1))==false {
/echo ran out of entrys
/end
}
/varset rg($int(@a1)) @Param$int(@a1)
/varset b1 $ini(consent.ini,consented,$int($int(@a1)),@rg($int(@a1)))
/ini inipath,consented,$int(@a1),@Param$int(@a1))
/echo $int(@a1) - @rg($int(@a1))
/goto :loop
/return

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Re: ini consent mac

Post by Curious » Fri Oct 17, 2003 3:09 am

Try changing

Code: Select all

/ini inipath,consented,$int(@a1),@Param$int(@a1))
to

Code: Select all

/ini "inipath" consented $int(@a1) "@Param$int(@a1))"
and see if it helps.

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

Post by Nanan » Sat Oct 18, 2003 1:44 am

My code still in testing, It will store unlimited number of names but overwrites the previous names atm. I will make it append once I figure out how to do it with the correct variables and for/next loops. The second half of the macro is the part that will do the consenting. I capped it high at 50 consents, currently EQ will only let you consent I think 20 people.. the rest will give the "you do not have permission to drag" message to the rest of the draggers.

Code: Select all

#define inipath "consent.ini"
Sub Main
|/echo usage: /mac consent name(1) name(2) name(3) ... name(n)
|/echo usage: /mac consent all   : Consents players in ini file if they exist.

/zapvars
/declare rg array
/declare a1 global
/declare b1 global
/declare c1 global
/declare d1 global
/varset a1 -1
:loop
/varadd a1 1
/if "@Param$int(@a1)"~~"help" {
/echo Yea yea this isnt working yet
/end
}
/if "@Param$int(@a1)"~~"all" {
/echo Consenting the following.
/goto :loop2
}
/if $defined(Param$int(@a1))==false {
/end
}

/varset rg($int(@a1)) @Param$int(@a1)
/ini "inipath" consented $int(@a1) "@Param$int(@a1)"
/echo $int(@a1) - @rg($int(@a1))
/goto :loop

:loop2
/echo starting phase2
/varset c1 -1
/for d1 1 to 50 [step 1] 
/varadd c1 1
|/varset b1 $ini(inipath,consented,$int(@c1))
|/varadd b1 @b1
/if "$ini(inipath,consented,$int(@c1))"~~"NOTFOUND" /end

/echo $ini(inipath,consented) - $ini(inipath,consented,$int(@c1))
/next d1
/return